#include <player_info.hpp>
Public Member Functions | |
lobby_player_info (events::chat_handler &chat, const mp::user_info &info, const mp::lobby_info &li) | |
~lobby_player_info () | |
bool | result_open_whisper () const |
![]() | |
modal_dialog () | |
virtual | ~modal_dialog () |
bool | show (const unsigned auto_close_time=0) |
Shows the window. More... | |
window * | get_window () const |
Returns a pointer to the dialog's window. More... | |
int | get_retval () const |
Returns the cached window exit code. More... | |
void | set_retval (int retval) |
Convenience wrapper to set the window's exit code. More... | |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
void | set_allow_plugin_skip (const bool allow_plugin_skip) |
void | set_show_even_without_video (const bool show_even_without_video) |
Private Member Functions | |
virtual const std::string & | window_id () const override |
The id of the window to build. More... | |
virtual void | pre_show (window &window) override |
Actions to be taken before showing the window. More... | |
virtual void | post_show (window &window) override |
Actions to be taken after the window has been shown. More... | |
void | update_relation () |
void | add_to_friends_button_callback () |
void | add_to_ignores_button_callback () |
void | remove_from_list_button_callback () |
void | start_whisper_button_callback () |
void | check_status_button_callback () |
void | kick_button_callback () |
void | kick_ban_button_callback () |
void | stopgame_button_callback () |
void | do_stopgame () |
void | do_kick_ban (bool ban) |
Private Attributes | |
events::chat_handler & | chat_ |
const mp::user_info & | info_ |
text_box * | reason_ |
text_box * | time_ |
label * | relation_ |
button * | add_to_friends_ |
button * | add_to_ignores_ |
button * | remove_from_list_ |
bool | result_open_whisper_ |
const mp::lobby_info & | lobby_info_ |
Additional Inherited Members | |
![]() | |
template<typename T , typename... Args> | |
T * | register_field (Args &&... args) |
Creates a new field of given type with given arguments. More... | |
field_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false) |
Creates a new boolean field. More... | |
field_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false) |
Creates a new boolean field. More... | |
field_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr) |
Creates a new integer field. More... | |
field_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
field_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false) |
Creates a new text field. More... | |
field_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
field_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
Registers a new styled_widget as a label. More... | |
field_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new styled_widget as image. More... | |
![]() | |
std::unique_ptr< window > | window_ |
The window object build for this dialog. More... | |
Definition at line 32 of file player_info.hpp.
gui2::dialogs::lobby_player_info::lobby_player_info | ( | events::chat_handler & | chat, |
const mp::user_info & | info, | ||
const mp::lobby_info & | li | ||
) |
Definition at line 37 of file player_info.cpp.
gui2::dialogs::lobby_player_info::~lobby_player_info | ( | ) |
Definition at line 53 of file player_info.cpp.
|
private |
Definition at line 164 of file player_info.cpp.
References preferences::add_acquaintance(), info_, mp::user_info::name, and update_relation().
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 170 of file player_info.cpp.
References preferences::add_acquaintance(), info_, mp::user_info::name, and update_relation().
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 188 of file player_info.cpp.
References chat_, gui2::window::close(), gui2::dialogs::modal_dialog::get_window(), info_, mp::user_info::name, and events::chat_handler::send_command().
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 223 of file player_info.cpp.
References chat_, gui2::text_box_base::get_value(), info_, mp::user_info::name, reason_, events::chat_handler::send_command(), and time_.
Referenced by kick_ban_button_callback(), kick_button_callback(), and result_open_whisper().
|
private |
Definition at line 212 of file player_info.cpp.
References chat_, gui2::text_box_base::get_value(), info_, mp::user_info::name, reason_, and events::chat_handler::send_command().
Referenced by result_open_whisper(), and stopgame_button_callback().
|
private |
Definition at line 200 of file player_info.cpp.
References gui2::window::close(), do_kick_ban(), and gui2::dialogs::modal_dialog::get_window().
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 194 of file player_info.cpp.
References gui2::window::close(), do_kick_ban(), and gui2::dialogs::modal_dialog::get_window().
Referenced by pre_show(), and result_open_whisper().
|
overrideprivatevirtual |
Actions to be taken after the window has been shown.
At this point the registered fields already stored their values (if the OK has been pressed).
window | The window which has been shown. |
Reimplemented from gui2::dialogs::modal_dialog.
Definition at line 131 of file player_info.cpp.
Referenced by result_open_whisper().
|
overrideprivatevirtual |
Actions to be taken before showing the window.
At this point the registered fields are registered and initialized with their initial values.
window | The window to be shown. |
Reimplemented from gui2::dialogs::modal_dialog.
Definition at line 57 of file player_info.cpp.
References _(), add_to_friends_, add_to_friends_button_callback(), add_to_ignores_, add_to_ignores_button_callback(), check_status_button_callback(), gui2::event::connect_signal_mouse_left_click(), gui2::widget::find(), mp::user_info::game_id, mp::lobby_info::get_game_by_id(), mp::user_info::get_relation(), info_, gui2::widget::invisible, kick_ban_button_callback(), kick_button_callback(), lobby_info_, mp::logged_in_as_moderator(), mp::user_info::ME, mp::user_info::name, mp::game_info::name, mp::user_info::observing, reason_, relation_, remove_from_list_, remove_from_list_button_callback(), gui2::widget::set_visible(), start_whisper_button_callback(), stopgame_button_callback(), time_, and update_relation().
Referenced by result_open_whisper().
|
private |
Definition at line 176 of file player_info.cpp.
References info_, mp::user_info::name, preferences::remove_acquaintance(), and update_relation().
Referenced by pre_show(), and result_open_whisper().
|
inline |
Definition at line 41 of file player_info.hpp.
References add_to_friends_button_callback(), add_to_ignores_button_callback(), check_status_button_callback(), do_kick_ban(), do_stopgame(), kick_ban_button_callback(), kick_button_callback(), post_show(), pre_show(), remove_from_list_button_callback(), result_open_whisper_, start_whisper_button_callback(), stopgame_button_callback(), update_relation(), and window_id().
Referenced by gui2::dialogs::mp_lobby::user_dialog_callback().
|
private |
Definition at line 182 of file player_info.cpp.
References gui2::window::close(), gui2::dialogs::modal_dialog::get_window(), and result_open_whisper_.
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 206 of file player_info.cpp.
References gui2::window::close(), do_stopgame(), and gui2::dialogs::modal_dialog::get_window().
Referenced by pre_show(), and result_open_whisper().
|
private |
Definition at line 135 of file player_info.cpp.
References _(), add_to_friends_, add_to_ignores_, mp::user_info::FRIEND, mp::user_info::get_relation(), mp::user_info::IGNORED, info_, mp::user_info::ME, mp::user_info::NEUTRAL, relation_, remove_from_list_, gui2::button::set_active(), and gui2::styled_widget::set_label().
Referenced by add_to_friends_button_callback(), add_to_ignores_button_callback(), pre_show(), remove_from_list_button_callback(), and result_open_whisper().
|
overrideprivatevirtual |
The id of the window to build.
Implements gui2::dialogs::modal_dialog.
Referenced by result_open_whisper().
|
private |
Definition at line 85 of file player_info.hpp.
Referenced by pre_show(), and update_relation().
|
private |
Definition at line 87 of file player_info.hpp.
Referenced by pre_show(), and update_relation().
|
private |
Definition at line 75 of file player_info.hpp.
Referenced by check_status_button_callback(), do_kick_ban(), and do_stopgame().
|
private |
Definition at line 77 of file player_info.hpp.
Referenced by add_to_friends_button_callback(), add_to_ignores_button_callback(), check_status_button_callback(), do_kick_ban(), do_stopgame(), pre_show(), remove_from_list_button_callback(), and update_relation().
|
private |
Definition at line 93 of file player_info.hpp.
Referenced by pre_show().
|
private |
Definition at line 79 of file player_info.hpp.
Referenced by do_kick_ban(), do_stopgame(), and pre_show().
|
private |
Definition at line 83 of file player_info.hpp.
Referenced by pre_show(), and update_relation().
|
private |
Definition at line 89 of file player_info.hpp.
Referenced by pre_show(), and update_relation().
|
private |
Definition at line 91 of file player_info.hpp.
Referenced by result_open_whisper(), and start_whisper_button_callback().
|
private |
Definition at line 81 of file player_info.hpp.
Referenced by do_kick_ban(), and pre_show().