16 #define GETTEXT_DOMAIN "wesnoth-lib"
37 #define ERR_GUI LOG_STREAM(err, log_gui)
38 #define WRN_GUI LOG_STREAM(warn, log_gui)
39 #define LOG_GUI LOG_STREAM(info, log_gui)
40 #define DBG_GUI LOG_STREAM(debug, log_gui)
59 listbox& sides_list = find_widget<listbox>(
"sides_list");
60 listbox& nicks_list = find_widget<listbox>(
"nicks_list");
76 const int side =
sides_.emplace_back(
t.side());
81 std::string side_str =
VGETTEXT(
"Side $side", {{
"side", std::to_string(side)}});
84 item[
"id"] = (
formatter() <<
"side_" << side).str();
85 item[
"label"] = side_str;
86 item[
"use_markup"] =
"true";
87 data.emplace(
"side", item);
95 std::set<std::string> temp_nicks;
105 temp_nicks.insert(observers.begin(), observers.end());
113 for(
const std::string& nick : temp_nicks) {
120 item[
"label"] = nick;
121 item[
"use_markup"] =
"true";
122 data.emplace(
"nick", item);
133 selected_side_ = find_widget<listbox>(
"sides_list").get_selected_row();
140 selected_nick_ = find_widget<listbox>(
"nicks_list").get_selected_row();
145 listbox& nicks_list = find_widget<listbox>(
"nicks_list");
149 for(
const std::string& nick :
nicks_) {
150 std::string label_str =
"";
168 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.
int get_retval() const
Returns the cached window exit code.
unsigned int selected_side_
std::vector< std::string > nicks_
virtual void pre_show() override
Actions to be taken before showing the window.
virtual void post_show() override
Actions to be taken after the window has been shown.
events::menu_handler & menu_handler_
void handle_sides_list_item_clicked()
unsigned int selected_nick_
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.
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).
static lg::log_domain log_gui("gui/dialogs/mp_change_control")
Handling of system events.
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.
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::string bold(Args &&... data)
std::string span_color(const color_t &color, Args &&... data)