16 #define GETTEXT_DOMAIN "wesnoth-lib"
38 #define ERR_GUI LOG_STREAM(err, log_gui)
39 #define WRN_GUI LOG_STREAM(warn, log_gui)
40 #define LOG_GUI LOG_STREAM(info, log_gui)
41 #define DBG_GUI LOG_STREAM(debug, log_gui)
60 listbox& sides_list = find_widget<listbox>(&
window,
"sides_list",
false);
61 listbox& nicks_list = find_widget<listbox>(&
window,
"nicks_list",
false);
74 for(
unsigned int side = 1; side <= num_sides; ++side) {
84 std::string side_str =
VGETTEXT(
"Side $side", {{
"side", std::to_string(side)}});
88 item[
"label"] = side_str;
89 item[
"use_markup"] =
"true";
98 std::set<std::string> temp_nicks;
108 temp_nicks.insert(observers.begin(), observers.end());
116 for(
const std::string& nick : temp_nicks) {
123 item[
"label"] = nick;
124 item[
"use_markup"] =
"true";
152 for(
const std::string& nick :
nicks_) {
153 std::string label_str =
"";
156 label_str =
formatter() <<
"<b>" << nick <<
"</b>";
162 find_widget<label>(row_grid, nick,
false).set_label(label_str);
171 DBG_GUI <<
"Main: changing control of side "
game_board & board() const
void request_control_change(int side_num, const std::string &player)
virtual const std::vector< team > & teams() const override
virtual const std::set< std::string > & observers() const override
static game_display * get_singleton()
Abstract base class for all modal dialogs.
window * get_window()
Returns a pointer to the dialog's window.
This shows the multiplayer change control dialog.
unsigned int selected_side_
std::vector< std::string > nicks_
events::menu_handler & menu_handler_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
void handle_sides_list_item_clicked()
unsigned int selected_nick_
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
void highlight_side_nick()
void handle_nicks_list_item_clicked()
std::vector< int > sides_
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.
const grid * get_row_grid(const unsigned row) const
Returns the grid of the wanted row.
base class of top level items, the only item which needs to store the final canvases to draw on.
This class stores all the data for a single 'side' (in game nomenclature).
const std::string & current_player() const
bool is_network_ai() const
static color_t get_side_color(int side)
Standard logging facilities (interface).
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
static lg::log_domain log_gui("gui/dialogs/mp_change_control")
Handling of system events.
std::string span_color(const color_t &color)
Returns a Pango formatting string using the provided color_t object.
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
@ OK
Dialog was closed with the OK button.
std::pair< std::string, unsigned > item
This file contains the settings handling of the widget library.