16 #define GETTEXT_DOMAIN "wesnoth-editor"
29 #define ERR_ED LOG_STREAM_INDENT(err, editor)
39 , last_map_generator_(
nullptr)
40 , current_map_generator_(0)
47 listbox& list = find_widget<listbox>(
"generators_list");
50 if(current == -1 ||
static_cast<unsigned>(current) >
map_generators_.size()) {
83 listbox& list = find_widget<listbox>(
"generators_list");
90 lrow[
"generator_name"][
"label"] = gen->config_name();
110 button& settings_button = find_widget<button>(
"settings");
122 return utils::nullopt;
virtual void pre_show() override
Actions to be taken before showing the window.
std::vector< std::unique_ptr< map_generator > > & map_generators_
Available map generators.
int current_map_generator_
Current map generator index.
utils::optional< uint32_t > get_seed()
void do_generator_selected()
Callback for generator list selection changes.
void do_settings()
Callback for the generator settings button.
map_generator * last_map_generator_
Last used map generator, must be in map_generators_.
std::string random_seed_
random seed integer input
void select_map_generator(map_generator *mg)
map_generator * get_selected_map_generator()
Abstract base class for all modal dialogs.
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.
bool select_last_row(const bool select=true)
Does exactly as advertised: selects the list's last row.
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.
int get_selected_row() const
Returns the first selected row.
void keyboard_capture(widget *widget)
virtual void user_config()
Display the interactive screen, which allows the user to modify how the generator behaves.
New lexcical_cast header.
REGISTER_DIALOG(editor_edit_unit)
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
std::map< std::string, widget_item > widget_data
Contains the general settings which have a default.
Thrown when a lexical_cast fails.