The Battle for Wesnoth  1.17.0-dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::lobby_player_info Class Reference

#include <player_info.hpp>

Inheritance diagram for gui2::dialogs::lobby_player_info:

Public Member Functions

 lobby_player_info (events::chat_handler &chat, mp::user_info &info, const mp::lobby_info &li)
 
 ~lobby_player_info ()
 
bool result_open_whisper () const
 
- Public Member Functions inherited from gui2::dialogs::modal_dialog
 modal_dialog ()
 
virtual ~modal_dialog ()
 
bool show (const unsigned auto_close_time=0)
 Shows the window. More...
 
windowget_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_handlerchat_
 
mp::user_infoinfo_
 
text_boxreason_
 
text_boxtime_
 
labelrelation_
 
buttonadd_to_friends_
 
buttonadd_to_ignores_
 
buttonremove_from_list_
 
bool result_open_whisper_
 
const mp::lobby_infolobby_info_
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::dialogs::modal_dialog
field_boolregister_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_boolregister_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_integerregister_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_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
field_textregister_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_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
field_labelregister_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_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new styled_widget as image. More...
 
- Protected Attributes inherited from gui2::dialogs::modal_dialog
std::unique_ptr< windowwindow_
 The window object build for this dialog. More...
 

Detailed Description

Definition at line 31 of file player_info.hpp.

Constructor & Destructor Documentation

◆ lobby_player_info()

gui2::dialogs::lobby_player_info::lobby_player_info ( events::chat_handler chat,
mp::user_info info,
const mp::lobby_info li 
)

Definition at line 36 of file player_info.cpp.

◆ ~lobby_player_info()

gui2::dialogs::lobby_player_info::~lobby_player_info ( )

Definition at line 52 of file player_info.cpp.

Member Function Documentation

◆ add_to_friends_button_callback()

void gui2::dialogs::lobby_player_info::add_to_friends_button_callback ( )
private

◆ add_to_ignores_button_callback()

void gui2::dialogs::lobby_player_info::add_to_ignores_button_callback ( )
private

◆ check_status_button_callback()

void gui2::dialogs::lobby_player_info::check_status_button_callback ( )
private

◆ do_kick_ban()

void gui2::dialogs::lobby_player_info::do_kick_ban ( bool  ban)
private

◆ do_stopgame()

void gui2::dialogs::lobby_player_info::do_stopgame ( )
private

◆ kick_ban_button_callback()

void gui2::dialogs::lobby_player_info::kick_ban_button_callback ( )
private

◆ kick_button_callback()

void gui2::dialogs::lobby_player_info::kick_button_callback ( )
private

◆ post_show()

void gui2::dialogs::lobby_player_info::post_show ( window window)
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).

Parameters
windowThe window which has been shown.

Reimplemented from gui2::dialogs::modal_dialog.

Definition at line 130 of file player_info.cpp.

Referenced by result_open_whisper().

◆ pre_show()

void gui2::dialogs::lobby_player_info::pre_show ( window window)
overrideprivatevirtual

◆ remove_from_list_button_callback()

void gui2::dialogs::lobby_player_info::remove_from_list_button_callback ( )
private

◆ result_open_whisper()

bool gui2::dialogs::lobby_player_info::result_open_whisper ( ) const
inline

◆ start_whisper_button_callback()

void gui2::dialogs::lobby_player_info::start_whisper_button_callback ( )
private

◆ stopgame_button_callback()

void gui2::dialogs::lobby_player_info::stopgame_button_callback ( )
private

◆ update_relation()

void gui2::dialogs::lobby_player_info::update_relation ( )
private

◆ window_id()

virtual const std::string& gui2::dialogs::lobby_player_info::window_id ( ) const
overrideprivatevirtual

The id of the window to build.

Implements gui2::dialogs::modal_dialog.

Referenced by result_open_whisper().

Member Data Documentation

◆ add_to_friends_

button* gui2::dialogs::lobby_player_info::add_to_friends_
private

Definition at line 84 of file player_info.hpp.

Referenced by pre_show(), and update_relation().

◆ add_to_ignores_

button* gui2::dialogs::lobby_player_info::add_to_ignores_
private

Definition at line 86 of file player_info.hpp.

Referenced by pre_show(), and update_relation().

◆ chat_

events::chat_handler& gui2::dialogs::lobby_player_info::chat_
private

Definition at line 74 of file player_info.hpp.

Referenced by check_status_button_callback(), do_kick_ban(), and do_stopgame().

◆ info_

mp::user_info& gui2::dialogs::lobby_player_info::info_
private

◆ lobby_info_

const mp::lobby_info& gui2::dialogs::lobby_player_info::lobby_info_
private

Definition at line 92 of file player_info.hpp.

Referenced by pre_show().

◆ reason_

text_box* gui2::dialogs::lobby_player_info::reason_
private

Definition at line 78 of file player_info.hpp.

Referenced by do_kick_ban(), do_stopgame(), and pre_show().

◆ relation_

label* gui2::dialogs::lobby_player_info::relation_
private

Definition at line 82 of file player_info.hpp.

Referenced by pre_show(), and update_relation().

◆ remove_from_list_

button* gui2::dialogs::lobby_player_info::remove_from_list_
private

Definition at line 88 of file player_info.hpp.

Referenced by pre_show(), and update_relation().

◆ result_open_whisper_

bool gui2::dialogs::lobby_player_info::result_open_whisper_
private

Definition at line 90 of file player_info.hpp.

Referenced by result_open_whisper(), and start_whisper_button_callback().

◆ time_

text_box* gui2::dialogs::lobby_player_info::time_
private

Definition at line 80 of file player_info.hpp.

Referenced by do_kick_ban(), and pre_show().


The documentation for this class was generated from the following files: