29 custom_tod(
const std::vector<time_of_day>& times,
int current_time,
const std::string& addon_id =
"");
47 virtual const std::string&
window_id()
const override;
63 template<custom_tod::
string_pair(*fptr)(const time_of_day&)>
void update_schedule()
Update current TOD with values from the GUI.
std::pair< std::string, std::string > string_pair
The execute function.
void update_image(const std::string &id_stem)
Update image when preview is pressed.
field_integer * color_field_g_
void set_selected_tod(time_of_day tod)
custom_tod(const std::vector< time_of_day > ×, int current_time, const std::string &addon_id="")
std::function< string_pair(const time_of_day &)> tod_attribute_getter
void color_slider_callback(COLOR_TYPE type)
const std::string addon_id_
ID of the current addon.
virtual const std::string & window_id() const override
The ID of the window to build.
void select_file(const std::string &default_dir)
void update_lawful_bonus()
void preview_schedule()
Callback for preview button.
std::vector< time_of_day > times_
Available time of days.
COLOR_TYPE
enum used in identifying sliders
virtual void post_show() override
Actions to be taken after the window has been shown.
const time_of_day & get_selected_tod() const
void update_selected_tod_info()
void do_next_tod()
Callback for the next tod button.
field_integer * color_field_b_
field_integer * color_field_r_
const std::vector< time_of_day > get_schedule()
Return current schedule.
void copy_to_clipboard_callback(const std::pair< std::string, tod_attribute_getter > &data)
void play_sound()
Play sound when play is pressed.
int current_tod_
Current time of day (ToD) index.
virtual void pre_show() override
Actions to be taken before showing the window.
void update_tod_display()
void register_callback(std::function< void(std::vector< time_of_day >)>)
Register callback for update.
std::function< void(std::vector< time_of_day >)> update_map_and_schedule_
Abstract base class for all modal dialogs.
Template class to implement the generic field implementation.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
#define DEFINE_SIMPLE_EXECUTE_WRAPPER(dialog)
Adds a bare-bonesstatic execute function to a dialog class that immediately invokes and return the re...
Object which defines a time of day with associated bonuses, image, sounds etc.