15 #define GETTEXT_DOMAIN "wesnoth-lib"
23 #ifdef GUI2_EXPERIMENTAL_LISTBOX
88 tlistbox& list = find_widget<tlistbox>(&window,
"era_list",
false);
101 tlistbox& era_list = find_widget<tlistbox>(&window,
"era_list",
false);
102 tlistbox& mod_list = find_widget<tlistbox>(&window,
"modification_list",
false);
103 tlabel& era_label = find_widget<tlabel>(&window,
"era_label",
false);
104 tlabel& mod_label = find_widget<tlabel>(&window,
"mod_label",
false);
110 std::map<std::string, string_map>
row;
113 column[
"label"] =
era;
114 row.insert(std::make_pair(
"era", column));
121 era_label.set_label(
_(
"Era:\n\nNot allowed."));
130 std::map<std::string, string_map>
row;
133 column[
"label"] = mod->name;
134 row.insert(std::make_pair(
"mod", column));
136 mod_list.add_row(row);
139 mod_list.select_row(i,
140 std::find(enabled.begin(), enabled.end(), mod->id)
146 mod_label.set_label(
_(
"Modifications:\n\nNone found."));
147 mod_list.set_active(
false);
154 find_widget<ttoggle_button>(&window,
"mp_connect",
false).set_value(
159 tlistbox& era_list = find_widget<tlistbox>(&window,
"era_list",
false);
160 tlistbox& mod_list = find_widget<tlistbox>(&window,
"modification_list",
false);
162 ttoggle_button& connect_toggle = find_widget<ttoggle_button>(&window,
"mp_connect",
false);
165 if (show_connect.blank() || show_connect.str() ==
"user") {
166 connect_toggle.set_active(
true);
168 connect_toggle.set_value(show_connect.to_bool());
169 connect_toggle.set_active(
false);
174 mod_list.set_callback_item_change(
181 find_widget<ttoggle_button>(&window,
"mp_connect",
false).get_value_bool();
void set_current_mod_index(const size_t index)
GLenum GLsizei const GLuint GLboolean enabled
const std::vector< extras_metadata_ptr > & get_const_extras_by_type(const MP_EXTRA extra_type) const
virtual void set_active(const bool active) override
See tcontrol::set_active.
level & current_level() const
bool select_row(const unsigned row, const bool select=true)
Selectes a row.
REGISTER_DIALOG(label_settings)
size_t current_era_index() const
void set_current_era_index(const size_t index, bool force=false)
bool toggle_current_mod(bool force=false)
Variant for storing WML attributes.
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.
void pre_show(twindow &window)
Inherited from tdialog.
static UNUSEDNOWARN std::string _(const char *str)
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.
const config & data() const
std::vector< std::string > & active_mods()
std::map< std::string, t_string > string_map
virtual bool allow_era_choice() const
GLenum GLenum GLvoid GLvoid * column
std::vector< std::string > extras_menu_item_names(const MP_EXTRA extra_type, bool escape_markup=true) const
GLenum GLenum GLvoid * row
bool find(E event, F functor)
Tests whether an event handler is available.
void change_mod(size_t index, twindow &window)
void post_show(twindow &window)
Inherited from tdialog.
void set_callback_item_change(const std::function< void(size_t)> &callback)
ng::create_engine & engine_
mp_game_settings & mp_settings()
Multiplayer parameters for this game.
int get_selected_row() const
Returns the first selected row.
void change_era(twindow &window)
GLsizei const GLcharARB ** string
void update_lists(twindow &window)
void clear()
Removes all the rows in the listbox, clearing it.