33 custom_tod(
const std::vector<time_of_day>& times,
int current_time,
const std::string addon_id =
"");
51 virtual const std::string&
window_id()
const override;
67 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)
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)
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
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
void copy_to_clipboard_callback(std::pair< std::string, tod_attribute_getter > data)
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_
custom_tod(const std::vector< time_of_day > ×, int current_time, const std::string addon_id="")
field_integer * color_field_r_
const std::vector< time_of_day > get_schedule()
Return current schedule.
void play_sound()
Play sound when play is pressed.
int current_tod_
Current time of day (ToD) index.
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_
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Abstract base class for all modal dialogs.
Template class to implement the generic field implementation.
base class of top level items, the only item which needs to store the final canvases to draw on.
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...
Various uncategorised dialogs.
Object which defines a time of day with associated bonuses, image, sounds etc.