15 #define GETTEXT_DOMAIN "wesnoth-editor"
92 , current_tod_name_(
nullptr)
93 , current_tod_id_(
nullptr)
94 , current_tod_image_(
nullptr)
95 , current_tod_mask_(
nullptr)
96 , current_tod_sound_(
nullptr)
97 , current_tod_number_(
nullptr)
98 , lawful_bonus_field_(register_integer("lawful_bonus", true))
99 , tod_red_field_(
nullptr)
100 , tod_green_field_(
nullptr)
101 , tod_blue_field_(
nullptr)
120 if(attribute ==
"image") {
122 }
else if(attribute ==
"mask") {
124 }
else if(attribute ==
"sound") {
152 if(
tods_.size() == 1) {
217 std::stringstream ss;
232 assert(!
tods_.empty());
235 = find_widget<tslider>(&window,
"tod_red",
false,
true);
238 = find_widget<tslider>(&window,
"tod_green",
false,
true);
241 = find_widget<tslider>(&window,
"tod_blue",
false,
true);
244 = find_widget<ttext_box>(&window,
"tod_name",
false,
true);
246 current_tod_id_ = find_widget<ttext_box>(&window,
"tod_id",
false,
true);
249 = find_widget<timage>(&window,
"current_tod_image",
false,
true);
252 = find_widget<timage>(&window,
"current_tod_mask",
false,
true);
255 = find_widget<tlabel>(&window,
"current_sound",
false,
true);
258 = find_widget<tlabel>(&window,
"tod_number",
false,
true);
264 "data/core/images/misc",
280 "data/core/sounds/ambient",
285 find_widget<tbutton>(&window,
"next_tod",
false),
289 find_widget<tbutton>(&window,
"previous_tod",
false),
293 find_widget<tbutton>(&window,
"new",
false),
297 find_widget<tbutton>(&window,
"delete",
false),
324 for(
size_t i = 0;
i <
tods_.size(); ++
i) {
326 const int r = tod_red_field_->get_value();
327 const int g = tod_green_field_->get_value();
328 const int b = tod_blue_field_->get_value();
ttext_box * current_tod_name_
Text boxes for name and id.
tlabel * current_tod_number_
tod_color color
The color modifications that should be made to the game board to reflect the time of day...
void update_selected_tod_info(twindow &window)
void update_tod_display(twindow &window)
void connect_signal_notify_modified(tdispatcher &dispatcher, const tsignal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
REGISTER_DIALOG(label_settings)
virtual void set_label(const t_string &label)
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
void set_value(const int value)
Inherited from tinteger_selector_.
T get_widget_value(twindow &window)
Gets the value of the field.
void undraw()
Undraws the window.
virtual void draw()
Draws invalidated items.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
const time_of_day & get_selected_tod() const
virtual void set_value(const std::string &text)
The set_value is virtual for the tpassword_box class.
timage * current_tod_image_
Images for the current tod.
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
GLdouble GLdouble GLdouble b
std::string default_dir()
editor::editor_display * display_
The display to update when the ToD changes.
Object which defines a time of day with associated bonuses, image, sounds etc.
static UNUSEDNOWARN std::string _(const char *str)
Dialog is closed with ok button.
ttext_box * current_tod_id_
int get_value() const
Inherited from tinteger_selector_.
void pre_show(twindow &window)
Inherited from tdialog.
std::string base_name(const std::string &file)
Returns the base filename of a file, with directory name stripped.
int show_file_chooser_dialog(CVideo &video, std::string &filename, std::string const &title, bool show_directory_buttons, const std::string &type_a_head, int xloc, int yloc)
Show a dialog where the user can navigate through files and select a file.
Manage the empty-palette in the editor.
void invalidate_all()
Function to invalidate all tiles.
void set_color_adjustment(int r, int g, int b)
will make all scaled images have these rgb values added to all their pixels.
void select_file(const std::string &filename, const std::string &default_dir, const std::string &attribute, twindow &window)
void set_widget_value(twindow &window, CT value)
Sets the value of the field.
void update_lawful_bonus(twindow &window)
tslider * tod_blue_field_
void do_delete_tod(twindow &window)
tlabel * current_tod_sound_
Labels for the current tod.
Declarations for File-IO.
GLdouble GLdouble GLdouble r
std::vector< time_of_day > tods_
Available time_of_days.
int current_tod_
Current map generator index.
GLuint const GLchar * name
void do_new_tod(twindow &window)
tfield_integer * lawful_bonus_field_
timage * current_tod_mask_
this module manages the cache of images.
CVideo & video()
Gets the underlying screen object.
void do_next_tod(twindow &window)
Callback for the next tod button.
void do_prev_tod(twindow &window)
GLsizei const GLcharARB ** string
void post_show(twindow &window)
Inherited from tdialog.
tslider * tod_green_field_
std::string directory_name(const std::string &file)
Returns the directory name of a file, with filename stripped.
void invalidate_layout()
Updates the size of the window.