The Battle for Wesnoth  1.15.1+dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::mp_join_game Class Reference

#include <mp_join_game.hpp>

Inheritance diagram for gui2::dialogs::mp_join_game:
Inheritance graph

Public Member Functions

 mp_join_game (saved_game &state, mp::lobby_info &lobby_info, wesnothd_connection &connection, const bool first_scenario=true, const bool observe_game=false)
 
 ~mp_join_game ()
 
bool fetch_game_config ()
 
bool started () 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
 
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
 Inherited from modal_dialog, implemented by REGISTER_DIALOG. More...
 
virtual void pre_show (window &window) override
 Inherited from modal_dialog. More...
 
virtual void post_show (window &window) override
 Inherited from modal_dialog. More...
 
bool show_flg_select (int side_num, bool first_time=false)
 
void generate_side_list (window &window)
 
void close_faction_select_dialog_if_open ()
 Will close the Faction Select dialog if it's open. More...
 
void network_handler (window &window)
 
configget_scenario ()
 
- Private Member Functions inherited from gui2::dialogs::plugin_executor
 plugin_executor ()
 
 ~plugin_executor ()
 

Private Attributes

config level_
 
saved_gamestate_
 
mp::lobby_infolobby_info_
 
wesnothd_connectionnetwork_connection_
 
std::size_t update_timer_
 
const bool first_scenario_
 
bool observe_game_
 
bool stop_updates_
 
std::map< std::string, tree_view_node * > team_tree_map_
 
std::unique_ptr< player_list_helperplayer_list_
 
faction_selectflg_dialog_
 
- Private Attributes inherited from gui2::dialogs::plugin_executor
std::unique_ptr< plugins_contextplugins_context_
 

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 35 of file mp_join_game.hpp.

Constructor & Destructor Documentation

◆ mp_join_game()

gui2::dialogs::mp_join_game::mp_join_game ( saved_game state,
mp::lobby_info lobby_info,
wesnothd_connection connection,
const bool  first_scenario = true,
const bool  observe_game = false 
)

Definition at line 61 of file mp_join_game.cpp.

◆ ~mp_join_game()

gui2::dialogs::mp_join_game::~mp_join_game ( )

Definition at line 76 of file mp_join_game.cpp.

References gui2::remove_timer(), and update_timer_.

Member Function Documentation

◆ close_faction_select_dialog_if_open()

void gui2::dialogs::mp_join_game::close_faction_select_dialog_if_open ( )
private

Will close the Faction Select dialog if it's open.

This is used in network_handler to dismiss the dialog if certain actions occur, such as the game starting.

Todo:
maybe move this to a general-purpose close() function in modal_dialog and modeless_dialog? It could be useful.

Definition at line 476 of file mp_join_game.cpp.

References gui2::CANCEL, flg_dialog_, gui2::dialogs::modal_dialog::get_window(), and w.

Referenced by network_handler(), and started().

◆ fetch_game_config()

bool gui2::dialogs::mp_join_game::fetch_game_config ( )

◆ generate_side_list()

void gui2::dialogs::mp_join_game::generate_side_list ( window window)
private

◆ get_scenario()

config & gui2::dialogs::mp_join_game::get_scenario ( )
private

◆ network_handler()

void gui2::dialogs::mp_join_game::network_handler ( window window)
private

◆ post_show()

void gui2::dialogs::mp_join_game::post_show ( window window)
overrideprivatevirtual

◆ pre_show()

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

◆ show_flg_select()

bool gui2::dialogs::mp_join_game::show_flg_select ( int  side_num,
bool  first_time = false 
)
private

◆ started()

bool gui2::dialogs::mp_join_game::started ( ) const
inline

◆ window_id()

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

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Referenced by started().

Member Data Documentation

◆ first_scenario_

const bool gui2::dialogs::mp_join_game::first_scenario_
private

Definition at line 85 of file mp_join_game.hpp.

Referenced by fetch_game_config(), and network_handler().

◆ flg_dialog_

faction_select* gui2::dialogs::mp_join_game::flg_dialog_
private

◆ level_

config gui2::dialogs::mp_join_game::level_
private

◆ lobby_info_

mp::lobby_info& gui2::dialogs::mp_join_game::lobby_info_
private

Definition at line 79 of file mp_join_game.hpp.

Referenced by pre_show().

◆ network_connection_

wesnothd_connection& gui2::dialogs::mp_join_game::network_connection_
private

◆ observe_game_

bool gui2::dialogs::mp_join_game::observe_game_
private

Definition at line 87 of file mp_join_game.hpp.

Referenced by fetch_game_config(), and post_show().

◆ player_list_

std::unique_ptr<player_list_helper> gui2::dialogs::mp_join_game::player_list_
private

Definition at line 92 of file mp_join_game.hpp.

Referenced by network_handler(), and pre_show().

◆ state_

saved_game& gui2::dialogs::mp_join_game::state_
private

Definition at line 77 of file mp_join_game.hpp.

Referenced by fetch_game_config(), post_show(), and show_flg_select().

◆ stop_updates_

bool gui2::dialogs::mp_join_game::stop_updates_
private

Definition at line 88 of file mp_join_game.hpp.

Referenced by generate_side_list(), and network_handler().

◆ team_tree_map_

std::map<std::string, tree_view_node*> gui2::dialogs::mp_join_game::team_tree_map_
private

Definition at line 90 of file mp_join_game.hpp.

Referenced by generate_side_list().

◆ update_timer_

std::size_t gui2::dialogs::mp_join_game::update_timer_
private

Definition at line 83 of file mp_join_game.hpp.

Referenced by post_show(), pre_show(), and ~mp_join_game().


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