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

#include <mp_staging.hpp>

Inheritance diagram for gui2::dialogs::mp_staging:
Inheritance graph

Public Member Functions

 mp_staging (ng::connect_engine &connect_engine, mp::lobby_info &lobby_info, wesnothd_connection *connection=nullptr)
 
 ~mp_staging ()
 
- 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...
 
void add_side_node (window &window, ng::side_engine_ptr side)
 
int get_side_node_position (ng::side_engine_ptr side) const
 Find an appropriate position to insert a side node. More...
 
void on_controller_select (ng::side_engine_ptr side, grid &row_grid)
 
void on_ai_select (ng::side_engine_ptr side, menu_button &ai_menu, const bool saved_game)
 
void on_color_select (ng::side_engine_ptr side, grid &row_grid)
 
void on_team_select (window &window, ng::side_engine_ptr side, menu_button &team_menu)
 
template<void(ng::side_engine::*)(int) fptr>
void on_side_slider_change (ng::side_engine_ptr side, slider &slider)
 
void select_leader_callback (ng::side_engine_ptr side, grid &row_grid)
 
void update_leader_display (ng::side_engine_ptr side, grid &row_grid)
 
void update_status_label_and_buttons (window &window)
 
void network_handler (window &window)
 
void set_state_changed ()
 
- Private Member Functions inherited from gui2::dialogs::plugin_executor
 plugin_executor ()
 
 ~plugin_executor ()
 

Private Attributes

ng::connect_engineconnect_engine_
 
std::vector< ai::description * > ai_algorithms_
 
mp::lobby_infolobby_info_
 
wesnothd_connectionnetwork_connection_
 
std::size_t update_timer_
 
bool state_changed_
 
std::map< std::string, tree_view_node * > team_tree_map_
 
std::map< ng::side_engine_ptr, tree_view_node * > side_tree_map_
 
std::unique_ptr< player_list_helperplayer_list_
 
- 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 37 of file mp_staging.hpp.

Constructor & Destructor Documentation

◆ mp_staging()

gui2::dialogs::mp_staging::mp_staging ( ng::connect_engine connect_engine,
mp::lobby_info lobby_info,
wesnothd_connection connection = nullptr 
)

Definition at line 49 of file mp_staging.cpp.

◆ ~mp_staging()

gui2::dialogs::mp_staging::~mp_staging ( )

Definition at line 65 of file mp_staging.cpp.

References gui2::remove_timer(), and update_timer_.

Member Function Documentation

◆ add_side_node()

void gui2::dialogs::mp_staging::add_side_node ( window window,
ng::side_engine_ptr  side 
)
private

◆ get_side_node_position()

int gui2::dialogs::mp_staging::get_side_node_position ( ng::side_engine_ptr  side) const
private

Find an appropriate position to insert a side node.

This ensures the side nodes are always arranged by descending index order in each team group.

Definition at line 150 of file mp_staging.cpp.

References connect_engine_, and ng::connect_engine::side_engines().

Referenced by add_side_node(), and on_team_select().

◆ network_handler()

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

◆ on_ai_select()

void gui2::dialogs::mp_staging::on_ai_select ( ng::side_engine_ptr  side,
menu_button ai_menu,
const bool  saved_game 
)
private

Definition at line 371 of file mp_staging.cpp.

References ai_algorithms_, gui2::menu_button::get_value(), i, and set_state_changed().

Referenced by add_side_node().

◆ on_color_select()

void gui2::dialogs::mp_staging::on_color_select ( ng::side_engine_ptr  side,
grid row_grid 
)
private

Definition at line 389 of file mp_staging.cpp.

References set_state_changed(), and update_leader_display().

Referenced by add_side_node().

◆ on_controller_select()

void gui2::dialogs::mp_staging::on_controller_select ( ng::side_engine_ptr  side,
grid row_grid 
)
private

◆ on_side_slider_change()

template<void(ng::side_engine::*)(int) fptr>
void gui2::dialogs::mp_staging::on_side_slider_change ( ng::side_engine_ptr  side,
slider slider 
)
private

Definition at line 431 of file mp_staging.cpp.

References gui2::slider::get_value(), and set_state_changed().

◆ on_team_select()

void gui2::dialogs::mp_staging::on_team_select ( window window,
ng::side_engine_ptr  side,
menu_button team_menu 
)
private

◆ post_show()

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

◆ pre_show()

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

◆ select_leader_callback()

void gui2::dialogs::mp_staging::select_leader_callback ( ng::side_engine_ptr  side,
grid row_grid 
)
private

Definition at line 421 of file mp_staging.cpp.

References set_state_changed(), and update_leader_display().

Referenced by add_side_node().

◆ set_state_changed()

void gui2::dialogs::mp_staging::set_state_changed ( )
inlineprivate

◆ update_leader_display()

void gui2::dialogs::mp_staging::update_leader_display ( ng::side_engine_ptr  side,
grid row_grid 
)
private

◆ update_status_label_and_buttons()

void gui2::dialogs::mp_staging::update_status_label_and_buttons ( window window)
private

◆ window_id()

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

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Member Data Documentation

◆ ai_algorithms_

std::vector<ai::description*> gui2::dialogs::mp_staging::ai_algorithms_
private

Definition at line 86 of file mp_staging.hpp.

Referenced by add_side_node(), and on_ai_select().

◆ connect_engine_

ng::connect_engine& gui2::dialogs::mp_staging::connect_engine_
private

◆ lobby_info_

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

Definition at line 88 of file mp_staging.hpp.

Referenced by pre_show().

◆ network_connection_

wesnothd_connection* gui2::dialogs::mp_staging::network_connection_
private

Definition at line 90 of file mp_staging.hpp.

Referenced by network_handler(), and pre_show().

◆ player_list_

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

Definition at line 99 of file mp_staging.hpp.

Referenced by network_handler(), and pre_show().

◆ side_tree_map_

std::map<ng::side_engine_ptr, tree_view_node*> gui2::dialogs::mp_staging::side_tree_map_
private

Definition at line 97 of file mp_staging.hpp.

Referenced by add_side_node(), network_handler(), and on_team_select().

◆ state_changed_

bool gui2::dialogs::mp_staging::state_changed_
private

Definition at line 94 of file mp_staging.hpp.

Referenced by network_handler(), and set_state_changed().

◆ team_tree_map_

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

Definition at line 96 of file mp_staging.hpp.

Referenced by add_side_node(), on_team_select(), and pre_show().

◆ update_timer_

std::size_t gui2::dialogs::mp_staging::update_timer_
private

Definition at line 92 of file mp_staging.hpp.

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


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