#include <custom_tod.hpp>
Public Member Functions | |
tcustom_tod (editor::editor_display *display, const std::vector< time_of_day > &tods) | |
Public Member Functions inherited from gui2::tdialog | |
tdialog () | |
virtual | ~tdialog () |
bool | show (CVideo &video, const unsigned auto_close_time=0) |
Shows the window. More... | |
int | get_retval () const |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
Static Public Member Functions | |
static bool | execute (editor::editor_display *display, const std::vector< time_of_day > &tods, CVideo &video) |
Private Member Functions | |
void | do_next_tod (twindow &window) |
Callback for the next tod button. More... | |
void | do_prev_tod (twindow &window) |
void | do_new_tod (twindow &window) |
void | do_delete_tod (twindow &window) |
void | select_file (const std::string &filename, const std::string &default_dir, const std::string &attribute, twindow &window) |
void | update_tod_display (twindow &window) |
void | update_lawful_bonus (twindow &window) |
void | set_selected_tod (time_of_day tod) |
const time_of_day & | get_selected_tod () const |
void | update_selected_tod_info (twindow &window) |
virtual const std::string & | window_id () const |
Inherited from tdialog, implemented by REGISTER_DIALOG. More... | |
void | pre_show (twindow &window) |
Inherited from tdialog. More... | |
void | post_show (twindow &window) |
Inherited from tdialog. More... | |
Private Attributes | |
std::vector< time_of_day > | tods_ |
Available time_of_days. More... | |
int | current_tod_ |
Current map generator index. More... | |
ttext_box * | current_tod_name_ |
Text boxes for name and id. More... | |
ttext_box * | current_tod_id_ |
timage * | current_tod_image_ |
Images for the current tod. More... | |
timage * | current_tod_mask_ |
tlabel * | current_tod_sound_ |
Labels for the current tod. More... | |
tlabel * | current_tod_number_ |
tfield_integer * | lawful_bonus_field_ |
tslider * | tod_red_field_ |
tslider * | tod_green_field_ |
tslider * | tod_blue_field_ |
editor::editor_display * | display_ |
The display to update when the ToD changes. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::tdialog | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>()) |
Creates a new integer field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
Registers a new control as a label. More... | |
tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new control as image. More... | |
Definition at line 42 of file custom_tod.hpp.
gui2::tcustom_tod::tcustom_tod | ( | editor::editor_display * | display, |
const std::vector< time_of_day > & | tods | ||
) |
Definition at line 88 of file custom_tod.cpp.
Referenced by execute().
Definition at line 149 of file custom_tod.cpp.
References current_tod_, tods_, and update_selected_tod_info().
Referenced by pre_show().
Definition at line 143 of file custom_tod.cpp.
References current_tod_, tods_, and update_selected_tod_info().
Referenced by pre_show().
Callback for the next tod button.
Definition at line 131 of file custom_tod.cpp.
References current_tod_, tods_, and update_selected_tod_info().
Referenced by pre_show().
Definition at line 137 of file custom_tod.cpp.
References current_tod_, tods_, and update_selected_tod_info().
Referenced by pre_show().
|
inlinestatic |
Definition at line 48 of file custom_tod.hpp.
References tcustom_tod().
Referenced by editor::editor_controller::custom_tods_dialog().
|
private |
Definition at line 164 of file custom_tod.cpp.
References current_tod_, and tods_.
Referenced by pre_show(), and update_selected_tod_info().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 339 of file custom_tod.cpp.
References gui2::tdialog::get_retval(), gui2::twindow::OK, and update_tod_display().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 230 of file custom_tod.cpp.
References tod_color::b, time_of_day::color, gui2::event::connect_signal_mouse_left_click(), gui2::event::connect_signal_notify_modified(), current_tod_, current_tod_id_, current_tod_image_, current_tod_mask_, current_tod_name_, current_tod_number_, current_tod_sound_, do_delete_tod(), do_new_tod(), do_next_tod(), do_prev_tod(), tod_color::g, get_selected_tod(), i, lawful_bonus_field_, tod_color::r, select_file(), tod_blue_field_, tod_green_field_, tod_red_field_, tods_, update_lawful_bonus(), update_selected_tod_info(), update_tod_display(), and gui2::tfield_::widget().
|
private |
Definition at line 106 of file custom_tod.cpp.
References _(), filesystem::base_name(), current_tod_, preferences::editor::default_dir(), filesystem::directory_name(), display_, dialogs::show_file_chooser_dialog(), tods_, update_selected_tod_info(), and display::video().
Referenced by pre_show().
|
private |
Definition at line 203 of file custom_tod.cpp.
References current_tod_, gui2::tfield< T, W, CT >::get_widget_value(), lawful_bonus_field_, and tods_.
Referenced by pre_show().
Definition at line 209 of file custom_tod.cpp.
References current_tod_, current_tod_id_, current_tod_image_, current_tod_mask_, current_tod_name_, current_tod_number_, current_tod_sound_, get_selected_tod(), lawful_bonus_field_, gui2::tcontrol::set_label(), gui2::tslider::set_value(), gui2::ttext_::set_value(), gui2::tfield< T, W, CT >::set_widget_value(), tod_blue_field_, tod_green_field_, tod_red_field_, tods_, and update_tod_display().
Referenced by do_delete_tod(), do_new_tod(), do_next_tod(), do_prev_tod(), pre_show(), and select_file().
Definition at line 170 of file custom_tod.cpp.
References display_, display::draw(), gui2::tslider::get_value(), display::invalidate_all(), gui2::twindow::invalidate_layout(), image::set_color_adjustment(), tod_blue_field_, tod_green_field_, tod_red_field_, and gui2::twindow::undraw().
Referenced by post_show(), pre_show(), and update_selected_tod_info().
|
privatevirtual |
Inherited from tdialog, implemented by REGISTER_DIALOG.
Implements gui2::tdialog.
|
private |
Current map generator index.
Definition at line 90 of file custom_tod.hpp.
Referenced by do_delete_tod(), do_new_tod(), do_next_tod(), do_prev_tod(), get_selected_tod(), pre_show(), select_file(), update_lawful_bonus(), and update_selected_tod_info().
|
private |
Definition at line 94 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
Images for the current tod.
Definition at line 97 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
Definition at line 98 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
Text boxes for name and id.
Definition at line 93 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
Definition at line 102 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
Labels for the current tod.
Definition at line 101 of file custom_tod.hpp.
Referenced by pre_show(), and update_selected_tod_info().
|
private |
The display to update when the ToD changes.
The pointer may be nullptr, in the unit tests, but normally it should be a pointer to a valid object.
Definition at line 115 of file custom_tod.hpp.
Referenced by select_file(), and update_tod_display().
|
private |
Definition at line 104 of file custom_tod.hpp.
Referenced by pre_show(), update_lawful_bonus(), and update_selected_tod_info().
|
private |
Definition at line 107 of file custom_tod.hpp.
Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().
|
private |
Definition at line 106 of file custom_tod.hpp.
Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().
|
private |
Definition at line 105 of file custom_tod.hpp.
Referenced by pre_show(), update_selected_tod_info(), and update_tod_display().
|
private |
Available time_of_days.
Definition at line 57 of file custom_tod.hpp.
Referenced by do_delete_tod(), do_new_tod(), do_next_tod(), do_prev_tod(), get_selected_tod(), pre_show(), select_file(), update_lawful_bonus(), and update_selected_tod_info().