15 #define GETTEXT_DOMAIN "wesnoth-lib"
19 #include <boost/multi_index_container.hpp>
27 #ifdef GUI2_EXPERIMENTAL_LISTBOX
36 #ifdef GUI2_EXPERIMENTAL_LISTBOX
48 , use_map_settings_(register_bool(
54 &tmp_create_game::update_map_settings>))
56 , shroud_(register_bool(
62 , turns_(register_integer(
72 , experience_(register_integer("experience_modifier",
81 find_widget<tminimap>(&window,
"minimap",
false).set_config(&
cfg_);
83 tlistbox& list = find_widget<tlistbox>(&window,
"map_list",
false);
84 #ifdef GUI2_EXPERIMENTAL_LISTBOX
91 dialog_callback<tmp_create_game, &tmp_create_game::update_map>);
96 item.insert(std::make_pair(
"label",
_(
"Load Game")));
97 item.insert(std::make_pair(
"tooltip",
_(
"Load Game...")));
117 if(map[
"allow_new_game"].to_bool(
true)) {
119 item.insert(std::make_pair(
"label", map[
"name"].str()));
120 item.insert(std::make_pair(
"tooltip", map[
"name"].str()));
137 find_widget<tlistbox>(&window,
"map_list",
false);
143 tminimap& minimap = find_widget<tminimap>(&window,
"minimap",
false);
145 const int index = find_widget<tlistbox>(&window,
"map_list",
false)
146 .get_selected_row() - 1;
150 std::advance(children.first, index);
174 if(use_map_settings) {
181 window, (*
scenario_)[
"random_start_time"].to_bool(
true));
193 (*
scenario_)[
"experience_modifier"].str()));
void update_map(twindow &window)
child_itors child_range(const std::string &key)
tfield_integer * experience_
void set_village_support(int value)
tfield_bool * use_map_settings_
All fields are also in the normal field vector, but they need to be manually controlled as well so ad...
void set_shroud(bool value)
tfield_bool * start_time_
void update_map_settings(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)
int get_village_gold(const std::string &value, const game_classification *classification)
Gets the village gold.
T get_widget_value(twindow &window)
Gets the value of the field.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
std::pair< const_child_iterator, const_child_iterator > const_child_itors
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.
int get_village_support(const std::string &value)
Gets the village unit level support.
static UNUSEDNOWARN std::string _(const char *str)
Dialog is closed with ok button.
void add_row(const string_map &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
void set_random_start_time(bool value)
Modify, read and display user preferences.
std::map< std::string, t_string > string_map
void set_widget_value(twindow &window, CT value)
Sets the value of the field.
int get_xp_modifier(const std::string &value)
Gets the xp modifier.
void set_turns(int value)
void pre_show(twindow &window)
Inherited from tdialog.
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
void widget_set_enabled(twindow &window, const bool enable, const bool sync)
Enables a widget.
void set_callback_value_change(const std::function< void(twidget &)> &callback)
A config object defines a single node in a WML file, with access to child nodes.
void post_show(twindow &window)
Inherited from tdialog.
void set_xp_modifier(int value)
int get_turns(const std::string &value)
Gets the number of turns.
void dialog_callback(twidget &caller)
Template for dialog callbacks.
void set_village_gold(int value)
void set_use_map_settings(bool value)
tfield_integer * support_
void set_map_data(const std::string &map_data)