16 #define GETTEXT_DOMAIN "wesnoth-editor" 33 #define ERR_ED LOG_STREAM_INDENT(err, editor) 43 , last_map_generator_(
nullptr)
44 , current_map_generator_(0)
54 if(current == -1 || static_cast<unsigned>(current) >
map_generators_.size()) {
87 listbox& list = find_widget<listbox>(&
window,
"generators_list",
false);
88 window.keyboard_capture(&list);
94 lrow[
"generator_name"][
"label"] = gen->config_name();
114 button& settings_button = find_widget<button>(&
window,
"settings",
false);
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
int current_map_generator_
Current map generator index.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void do_settings()
Callback for the generator settings button.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
New lexcical_cast header.
std::optional< uint32_t > get_seed()
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
void do_generator_selected()
Callback for generator list selection changes.
bool select_last_row(const bool select=true)
Does exactly as advertised: selects the list's last row.
int get_selected_row() const
Returns the first selected row.
To lexical_cast(From value)
Lexical cast converts one type to another.
map_generator * get_selected_map_generator()
field_text * register_text(const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false)
Creates a new text field.
map_generator * last_map_generator_
Last used map generator, must be in map_generators_.
This file contains the settings handling of the widget library.
void select_map_generator(map_generator *mg)
std::vector< std::unique_ptr< map_generator > > & map_generators_
Available map generators.
virtual void user_config()
Display the interactive screen, which allows the user to modify how the generator behaves...
window * get_window()
Returns a pointer to the dialog's window.
Contains the general settings which have a default.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
std::string random_seed_
random seed integer input
std::map< std::string, widget_item > widget_data
The dialog for selecting which random generator to use in the editor.
base class of top level items, the only item which needs to store the final canvases to draw on...
Thrown when a lexical_cast fails.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.