void custom_tod::update_selected_tod_info(window& window)
{
	const time_of_day& current_tod = get_selected_tod();

	find_widget<text_box>(&window, "tod_name", false).set_value(current_tod.name);
	find_widget<text_box>(&window, "tod_id", false).set_value(current_tod.id);

	find_widget<text_box>(&window, "path_image", false).set_value(current_tod.image);
	find_widget<text_box>(&window, "path_mask", false).set_value(current_tod.image_mask);
	find_widget<text_box>(&window, "path_sound", false).set_value(current_tod.sounds);

	find_widget<image>(&window, "current_tod_image", false).set_image(current_tod.image);
	find_widget<image>(&window, "current_tod_mask", false).set_image(current_tod.image_mask);

	find_widget<slider>(&window, "lawful_bonus", false).set_value(current_tod.lawful_bonus);

	color_field_r_->set_widget_value(window, current_tod.color.r);
	color_field_g_->set_widget_value(window, current_tod.color.g);
	color_field_b_->set_widget_value(window, current_tod.color.b);

	const std::string new_index_str = formatter() << (current_tod_ + 1) << "/" << times_.size();
	find_widget<label>(&window, "tod_number", false).set_label(new_index_str);

	update_tod_display(window);
}
void teditor_settings::update_selected_tod_info(twindow& window)
{
	bool custom = custom_tod_toggle_->get_value();
	if (custom) {
		current_tod_label_->set_label(_("Custom setting"));
	} else {
		std::stringstream ss;
		ss << (current_tod_ + 1);
		ss << "/" << tods_.size();
		ss << ": " << get_selected_tod().name;
		current_tod_label_->set_label(ss.str());
		/**
		 * @todo Implement the showing of the ToD icon.
		 *
		 * Note at the moment the icon is a label widget, should become an
		 * image widget.
		 */
		//current_tod_image_->set_icon_name(get_selected_tod().image);
		custom_tod_red_->set_value(get_selected_tod().red);
		custom_tod_green_->set_value(get_selected_tod().green);
		custom_tod_blue_->set_value(get_selected_tod().blue);
		custom_tod_red_field_->set_cache_value(get_selected_tod().red);
		custom_tod_green_field_->set_cache_value(get_selected_tod().green);
		custom_tod_blue_field_->set_cache_value(get_selected_tod().blue);
	}
	custom_tod_red_->set_active(custom);
	custom_tod_green_->set_active(custom);
	custom_tod_blue_->set_active(custom);
	current_tod_label_->set_active(!custom);
	update_tod_display(window);
	window.invalidate_layout();
}
Exemple #3
0
void custom_tod::post_show(window& window)
{
	update_tod_display(window);
	
	if(get_retval() == window::OK) {
		// TODO: save ToD
	}
}
void custom_tod::color_slider_callback(window& window)
{
	time_of_day& current_tod = times_[current_tod_];

	current_tod.color.r = color_field_r_->get_widget_value(window);
	current_tod.color.g = color_field_g_->get_widget_value(window);
	current_tod.color.b = color_field_b_->get_widget_value(window);

	update_tod_display(window);
}
Exemple #5
0
void custom_tod::update_selected_tod_info(window& window)
{
	current_tod_name_->set_value(get_selected_tod().name);
	current_tod_id_->set_value(get_selected_tod().id);
	current_tod_image_->set_image(get_selected_tod().image);
	current_tod_mask_->set_image(get_selected_tod().image_mask);
	current_tod_sound_->set_label(get_selected_tod().sounds);

	std::stringstream ss;
	ss << (current_tod_ + 1) << "/" << tods_.size();
	current_tod_number_->set_label(ss.str());

	lawful_bonus_field_->set_widget_value(window,
										  get_selected_tod().lawful_bonus);
	tod_red_field_->set_value(get_selected_tod().color.r);
	tod_green_field_->set_value(get_selected_tod().color.g);
	tod_blue_field_->set_value(get_selected_tod().color.b);

	update_tod_display(window);
}
void teditor_settings::slider_update_callback(twindow& window)
{
	if (custom_tod_auto_refresh_->get_value()) {
		update_tod_display(window);
	}
}
Exemple #7
0
void teditor_settings::post_show(twindow& window)
{
    update_tod_display(window);

	can_update_display_ = false;
}