39 const
mp::lobby_info& li)
45 , add_to_friends_(
nullptr)
46 , add_to_ignores_(
nullptr)
47 , remove_from_list_(
nullptr)
48 , result_open_whisper_(false)
59 relation_ = find_widget<label>(&window,
"relation_info",
false,
true);
61 button& whisper = find_widget<button>(&window,
"start_whisper",
false);
66 whisper.set_active(
false);
69 add_to_friends_ = find_widget<button>(&window,
"add_to_friends",
false,
true);
74 add_to_ignores_ = find_widget<button>(&window,
"add_to_ignores",
false,
true);
80 = find_widget<button>(&window,
"remove_from_list",
false,
true);
86 find_widget<button>(&window,
"check_status",
false),
90 find_widget<button>(&window,
"kick",
false),
94 find_widget<button>(&window,
"kick_ban",
false),
98 find_widget<button>(&window,
"stopgame",
false),
101 find_widget<label>(&window,
"player_name",
false).set_label(
info_.
name);
103 std::stringstream loc;
105 if(game !=
nullptr) {
106 loc <<
_(
"In game:") <<
" " << game->
name <<
" ";
108 loc <<
_(
"(observing)");
110 loc <<
_(
"(playing)");
113 loc <<
_(
"In lobby");
116 time_ = find_widget<text_box>(&window,
"time",
false,
true);
117 reason_ = find_widget<text_box>(&window,
"reason",
false,
true);
118 window.add_to_tab_order(reason_);
119 window.add_to_tab_order(
time_);
121 find_widget<label>(&window,
"location_info",
false).set_label(loc.str());
214 std::stringstream ss;
225 std::stringstream ss;
226 ss << (ban ?
"kban " :
"kick ") <<
info_.
name;
void close()
Requests to close the window.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void kick_button_callback()
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
void start_whisper_button_callback()
This class represents the info a client has about a game on the server.
std::string get_value() const
void do_kick_ban(bool ban)
const mp::user_info & info_
void send_command(const std::string &cmd, const std::string &args="")
window * get_window() const
Returns a pointer to the dialog's window.
static std::string _(const char *str)
void check_status_button_callback()
bool remove_acquaintance(const std::string &nick)
const mp::lobby_info & lobby_info_
bool logged_in_as_moderator()
Gets whether the currently logged-in user is a moderator.
game_info * get_game_by_id(int id)
Returns info on a game with the given game ID.
Main entry points of multiplayer mode.
user_relation get_relation() const
This file contains the settings handling of the widget library.
void kick_ban_button_callback()
std::pair< preferences::acquaintance *, bool > add_acquaintance(const std::string &nick, const std::string &mode, const std::string ¬es)
void add_to_ignores_button_callback()
button * remove_from_list_
events::chat_handler & chat_
void add_to_friends_button_callback()
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Handling of system events.
void remove_from_list_button_callback()
bool result_open_whisper_
base class of top level items, the only item which needs to store the final canvases to draw on...
void stopgame_button_callback()