tcustom_tod: cleaned up code and unused related preference keys

This commit is contained in:
Charles Dang 2016-04-06 01:24:00 +11:00
parent 73739a1989
commit b7b8b1e213
6 changed files with 474 additions and 556 deletions

View file

@ -4,398 +4,406 @@
###
[window]
id = "custom_tod"
description = "Custom ToD schedules dialog."
id = "custom_tod"
description = "Custom ToD schedules dialog."
[resolution]
definition = "default"
[resolution]
definition = "default"
automatic_placement = "true"
vertical_placement = "center"
horizontal_placement = "center"
automatic_placement = "true"
vertical_placement = "center"
horizontal_placement = "center"
[tooltip]
id = "tooltip"
[/tooltip]
[tooltip]
id = "tooltip"
[/tooltip]
[helptip]
id = "tooltip"
[/helptip]
[helptip]
id = "tooltip"
[/helptip]
[linked_group]
id = "labels"
fixed_width = "true"
[/linked_group]
[linked_group]
id = "labels"
fixed_width = "true"
[/linked_group]
[linked_group]
id = "tod_index"
fixed_width = "true"
[/linked_group]
[linked_group]
id = "tod_index"
fixed_width = "true"
[/linked_group]
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Custom Time Schedule"
[/label]
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_alignment = "left"
[grid]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Name:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[text_box]
id = "tod_name"
definition = "default"
[/text_box]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[image]
id = "current_tod_image"
definition = "default"
[/image]
[/column]
[/row]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "ID:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[text_box]
id = "tod_id"
definition = "default"
[/text_box]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[image]
id = "current_tod_mask"
definition = "default"
[/image]
[/column]
[/row]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Metadata:"
[/label]
[/column]
[column]
horizontal_alignment = "left"
[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "image_button"
definition = "default"
label = _ "Image"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "mask_button"
definition = "default"
label = _ "Mask"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "sound_button"
definition = "default"
label = _ "Sound"
[/button]
[/column]
[/row]
[/grid]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[label]
id = "current_sound"
definition = "default"
[/label]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
[column]
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Lawful Bonus:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "lawful_bonus"
definition = "default"
best_slider_length = 512
minimum_value = -100
maximum_value = 100
step_size = 5
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Red:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_red"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Green:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_green"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Blue:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_blue"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
[grid]
[row]
grow_factor = 1
[column]
horizontal_alignment = "left"
[grid]
[row]
grow_factor = 1
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "previous_tod"
definition = "left_arrow"
linked_group = "tod_index"
label = _ "Previous"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
id = "tod_number"
definition = "default"
linked_group = "tod_index"
[/label]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "next_tod"
definition = "right_arrow"
linked_group = "tod_index"
label = _ "Next"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "new"
definition = "add"
label = _ "New ToD"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "delete"
definition = "delete"
label = _ "Delete ToD"
[/button]
[/column]
[/row]
[/grid]
[/column]
[column]
horizontal_alignment = "right"
[grid]
[row]
grow_factor = 1
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "save"
definition = "default"
label = _ "OK"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "cancel"
definition = "default"
label = _ "Cancel"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/resolution]
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "title"
label = _ "Custom Time Schedule"
[/label]
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Name:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[text_box]
id = "tod_name"
definition = "default"
[/text_box]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[image]
id = "current_tod_image"
definition = "default"
[/image]
[/column]
[/row]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "ID:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[text_box]
id = "tod_id"
definition = "default"
[/text_box]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[image]
id = "current_tod_mask"
definition = "default"
[/image]
[/column]
[/row]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Metadata:"
[/label]
[/column]
[column]
horizontal_alignment = "left"
[grid]
[row]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "image_button"
definition = "default"
label = _ "Image"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "mask_button"
definition = "default"
label = _ "Mask"
[/button]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "sound_button"
definition = "default"
label = _ "Sound"
[/button]
[/column]
[/row]
[/grid]
[/column]
[column]
border = "all"
border_size = 5
horizontal_alignment = "right"
[label]
id = "current_sound"
definition = "default"
[/label]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
[column]
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Lawful Bonus:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "lawful_bonus"
definition = "default"
best_slider_length = 512
minimum_value = -100
maximum_value = 100
step_size = 5
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Red:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_red"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Green:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_green"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[row]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
definition = "default"
linked_group = "labels"
label = _ "Blue:"
[/label]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[slider]
id = "tod_blue"
definition = "default"
best_slider_length = 512
minimum_value = -255
maximum_value = 255
step_size = 1
[/slider]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "previous_tod"
definition = "left_arrow"
linked_group = "tod_index"
label = _ "Previous"
[/button]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[label]
id = "tod_number"
definition = "default"
linked_group = "tod_index"
[/label]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "next_tod"
definition = "right_arrow"
linked_group = "tod_index"
label = _ "Next"
[/button]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "new"
definition = "add"
label = _ "New ToD"
[/button]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"
[button]
id = "delete"
definition = "delete"
label = _ "Delete ToD"
[/button]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "ok"
definition = "default"
label = _ "OK"
[/button]
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "right"
[button]
id = "cancel"
definition = "default"
label = _ "Cancel"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[/grid]
[/resolution]
[/window]

View file

@ -86,7 +86,6 @@ editor_controller::editor_controller(const config &game_config, CVideo& video)
init_music(game_config);
context_manager_->get_map_context().set_starting_position_labels(gui());
cursor::set(cursor::NORMAL);
image::set_color_adjustment(preferences::editor::tod_r(), preferences::editor::tod_g(), preferences::editor::tod_b());
gui().create_buttons();
gui().redraw_everything();

View file

@ -50,51 +50,6 @@ namespace editor {
preferences::set("editor_draw_hex_coordinates", value);
}
namespace {
void normalize_editor_rgb(int rval)
{
if (rval < -255) {
rval = -255;
}
else if (rval > 255) {
rval = 255;
}
}
}
void set_tod_r(int value)
{
normalize_editor_rgb(value);
preferences::set("editor_r",std::to_string(value));
}
void set_tod_g(int value)
{
normalize_editor_rgb(value);
preferences::set("editor_g",std::to_string(value));
}
void set_tod_b(int value)
{
normalize_editor_rgb(value);
preferences::set("editor_b",std::to_string(value));
}
int tod_r()
{
return lexical_cast_in_range<int>(preferences::get("editor_r"), 0, -255, 255);
}
int tod_g()
{
return lexical_cast_in_range<int>(preferences::get("editor_g"), 0, -255, 255);
}
int tod_b()
{
return lexical_cast_in_range<int>(preferences::get("editor_b"), 0, -255, 255);
}
namespace {
size_t editor_mru_limit()
{

View file

@ -42,21 +42,6 @@ namespace editor {
bool draw_hex_coordinates();
void set_draw_hex_coordinates(bool value);
/** Set editor red tint level. */
void set_tod_r(int value);
/** Set editor green tint level. */
void set_tod_g(int value);
/** Set editor blue tint level. */
void set_tod_b(int value);
/** Get editor red tint level. */
int tod_r();
/** Get editor green tint level. */
int tod_g();
/** Get editor blue tint level. */
int tod_b();
/** Retrieves the list of recently opened files. */
std::vector<std::string> recent_files();
/** Adds an entry to the recent files list. */

View file

@ -96,42 +96,32 @@ tcustom_tod::tcustom_tod(editor::editor_display* display,
, current_tod_sound_(nullptr)
, current_tod_number_(nullptr)
, lawful_bonus_field_(register_integer("lawful_bonus", true))
, tod_red_field_(register_integer("tod_red",
true,
&preferences::editor::tod_r,
&preferences::editor::set_tod_r))
, tod_green_field_(register_integer("tod_green",
true,
&preferences::editor::tod_g,
&preferences::editor::set_tod_g))
, tod_blue_field_(register_integer("tod_blue",
true,
&preferences::editor::tod_b,
&preferences::editor::set_tod_b))
, tod_red_field_(nullptr)
, tod_green_field_(nullptr)
, tod_blue_field_(nullptr)
, display_(display)
{
}
void tcustom_tod::select_file(const std::string& filename,
const std::string& dir,
const std::string& vector_attrib,
const std::string& default_dir,
const std::string& attribute,
twindow& window)
{
std::string va = vector_attrib;
std::string fn = filesystem::base_name(filename);
std::string dn = filesystem::directory_name(fn);
if(dn.empty()) {
dn = dir;
dn = default_dir;
}
int res = dialogs::show_file_chooser_dialog(
display_->video(), dn, _("Choose File"));
if(res == 0) {
if(va == "image") {
if(attribute == "image") {
tods_[current_tod_].image = dn;
} else if(va == "mask") {
} else if(attribute == "mask") {
tods_[current_tod_].image_mask = dn;
} else if(va == "sound") {
} else if(attribute == "sound") {
tods_[current_tod_].sounds = dn;
}
}
@ -171,11 +161,6 @@ void tcustom_tod::do_delete_tod(twindow& window)
update_selected_tod_info(window);
}
const std::vector<time_of_day>& tcustom_tod::do_save_schedule() const
{
return tods_;
}
const time_of_day& tcustom_tod::get_selected_tod() const
{
assert(static_cast<size_t>(current_tod_) < tods_.size());
@ -184,15 +169,14 @@ const time_of_day& tcustom_tod::get_selected_tod() const
void tcustom_tod::update_tod_display(twindow& window)
{
image::set_color_adjustment(tod_red_field_->get_widget_value(window),
tod_green_field_->get_widget_value(window),
tod_blue_field_->get_widget_value(window));
image::set_color_adjustment(tod_red_field_->get_value(),
tod_green_field_->get_value(),
tod_blue_field_->get_value());
if(!display_) {
return;
}
// Prevent a floating slice of window appearing alone over the
// theme UI sidebar after redrawing tiles and before we have a
// chance to redraw the rest of this window.
@ -209,6 +193,7 @@ void tcustom_tod::update_tod_display(twindow& window)
// invalidate all tiles so they are redrawn with the new ToD tint next
display_->invalidate_all();
// redraw tiles
display_->draw(false);
@ -221,11 +206,6 @@ void tcustom_tod::update_lawful_bonus(twindow& window)
= lawful_bonus_field_->get_widget_value(window);
}
void tcustom_tod::slider_update_callback(twindow& window)
{
update_tod_display(window);
}
void tcustom_tod::update_selected_tod_info(twindow& window)
{
current_tod_name_->set_value(get_selected_tod().name);
@ -235,23 +215,31 @@ void tcustom_tod::update_selected_tod_info(twindow& window)
current_tod_sound_->set_label(get_selected_tod().sounds);
std::stringstream ss;
ss << (current_tod_ + 1);
ss << "/" << tods_.size();
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_widget_value(window, get_selected_tod().color.r);
tod_green_field_->set_widget_value(window, get_selected_tod().color.g);
tod_blue_field_->set_widget_value(window, get_selected_tod().color.b);
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);
window.invalidate_layout();
}
void tcustom_tod::pre_show(twindow& window)
{
assert(!tods_.empty());
tod_red_field_
= find_widget<tslider>(&window, "tod_red", false, true);
tod_green_field_
= find_widget<tslider>(&window, "tod_green", false, true);
tod_blue_field_
= find_widget<tslider>(&window, "tod_blue", false, true);
current_tod_name_
= find_widget<ttext_box>(&window, "tod_name", false, true);
@ -269,94 +257,75 @@ void tcustom_tod::pre_show(twindow& window)
current_tod_number_
= find_widget<tlabel>(&window, "tod_number", false, true);
tbutton& image_button
= find_widget<tbutton>(&window, "image_button", false);
connect_signal_mouse_left_click(image_button,
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().image,
"data/core/images/misc",
"image",
std::ref(window)));
connect_signal_mouse_left_click(find_widget<tbutton>(&window, "image_button", false),
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().image,
"data/core/images/misc",
"image",
std::ref(window)));
tbutton& mask_button = find_widget<tbutton>(&window, "mask_button", false);
;
connect_signal_mouse_left_click(mask_button,
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().image_mask,
"data/core/images",
"mask",
std::ref(window)));
connect_signal_mouse_left_click(find_widget<tbutton>(&window, "mask_button", false),
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().image_mask,
"data/core/images",
"mask",
std::ref(window)));
tbutton& sound_button
= find_widget<tbutton>(&window, "sound_button", false);
connect_signal_mouse_left_click(sound_button,
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().sounds,
"data/core/sounds/ambient",
"sound",
std::ref(window)));
connect_signal_mouse_left_click(find_widget<tbutton>(&window, "sound_button", false),
std::bind(&tcustom_tod::select_file,
this,
get_selected_tod().sounds,
"data/core/sounds/ambient",
"sound",
std::ref(window)));
tbutton& next_tod_button = find_widget<tbutton>(&window, "next_tod", false);
connect_signal_mouse_left_click(
next_tod_button,
find_widget<tbutton>(&window, "next_tod", false),
std::bind(&tcustom_tod::do_next_tod, this, std::ref(window)));
tbutton& prev_tod_button
= find_widget<tbutton>(&window, "previous_tod", false);
connect_signal_mouse_left_click(
prev_tod_button,
find_widget<tbutton>(&window, "previous_tod", false),
std::bind(&tcustom_tod::do_prev_tod, this, std::ref(window)));
tbutton& new_button = find_widget<tbutton>(&window, "new", false);
connect_signal_mouse_left_click(
new_button,
find_widget<tbutton>(&window, "new", false),
std::bind(&tcustom_tod::do_new_tod, this, std::ref(window)));
tbutton& delete_button = find_widget<tbutton>(&window, "delete", false);
connect_signal_mouse_left_click(
delete_button,
find_widget<tbutton>(&window, "delete", false),
std::bind(&tcustom_tod::do_delete_tod, this, std::ref(window)));
// FIXME: This doesn't work (it does nothing at all)
/*
tbutton& save_button = find_widget<tbutton>(&window, "save", false);
connect_signal_mouse_left_click(
save_button, std::bind(&tcustom_tod::do_save_schedule, this));
*/
connect_signal_notify_modified(
*(lawful_bonus_field_->widget()),
std::bind(&tcustom_tod::update_lawful_bonus,
this,
std::ref(window)));
this,
std::ref(window)));
connect_signal_notify_modified(
*(tod_red_field_->widget()),
std::bind(&tcustom_tod::slider_update_callback,
this,
std::ref(window)));
*tod_red_field_,
std::bind(&tcustom_tod::update_tod_display,
this,
std::ref(window)));
connect_signal_notify_modified(
*(tod_green_field_->widget()),
std::bind(&tcustom_tod::slider_update_callback,
this,
std::ref(window)));
*tod_green_field_,
std::bind(&tcustom_tod::update_tod_display,
this,
std::ref(window)));
connect_signal_notify_modified(
*(tod_blue_field_->widget()),
std::bind(&tcustom_tod::slider_update_callback,
this,
std::ref(window)));
*tod_blue_field_,
std::bind(&tcustom_tod::update_tod_display,
this,
std::ref(window)));
for(size_t i = 0; i < tods_.size(); ++i) {
time_of_day& tod = tods_[i];
const int r = tod_red_field_->get_widget_value(window);
const int g = tod_green_field_->get_widget_value(window);
const int b = tod_blue_field_->get_widget_value(window);
const int r = tod_red_field_->get_value();
const int g = tod_green_field_->get_value();
const int b = tod_blue_field_->get_value();
if(tod.color.r == r && tod.color.g == g && tod.color.b == b) {
current_tod_ = i;
update_selected_tod_info(window);
@ -370,6 +339,10 @@ void tcustom_tod::pre_show(twindow& window)
void tcustom_tod::post_show(twindow& window)
{
update_tod_display(window);
if(get_retval() == twindow::OK) {
// TODO: save ToD
}
}
} // namespace gui2

View file

@ -36,6 +36,7 @@ namespace gui2
class tlabel;
class timage;
class tslider;
class ttext_box;
class tcustom_tod : public tdialog
@ -61,19 +62,16 @@ private:
void do_new_tod(twindow& window);
void do_delete_tod(twindow& window);
const std::vector<time_of_day>& do_save_schedule() const;
void select_file(const std::string& filename,
const std::string& dir,
const std::string& vector_attrib,
const std::string& default_dir,
const std::string& attribute,
twindow& window);
void update_tod_display(twindow& window);
void update_lawful_bonus(twindow& window);
void slider_update_callback(twindow& window);
void set_selected_tod(time_of_day tod);
const time_of_day& get_selected_tod() const;
@ -104,9 +102,9 @@ private:
tlabel* current_tod_number_;
tfield_integer* lawful_bonus_field_;
tfield_integer* tod_red_field_;
tfield_integer* tod_green_field_;
tfield_integer* tod_blue_field_;
tslider* tod_red_field_;
tslider* tod_green_field_;
tslider* tod_blue_field_;
/**
* The display to update when the ToD changes.