The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
mp::configure Class Reference

#include <multiplayer_configure.hpp>

Inheritance diagram for mp::configure:
Inheritance graph

Classes

struct  nolock_settings
 
struct  process_event_data
 

Public Member Functions

 configure (CVideo &v, twesnothd_connection *wesnothd_connection, const config &game_config, chat &c, config &gamelist, saved_game &game, bool local_players_only)
 gives the user the option to adjust the passed saved_game Call get_parameters to finalize; More...
 
 ~configure ()
 
void get_parameters ()
 
- Public Member Functions inherited from mp::ui
 ui (CVideo &v, twesnothd_connection *wesnothd_connection, const std::string &title, const config &cfg, chat &c, config &gamelist)
 
void process_network ()
 Asks the multiplayer_ui to pump some data from the network, and then to process it. More...
 
result get_result ()
 Returns the result of the current widget. More...
 
void set_location (const SDL_Rect &rect)
 Hides children, moves them (using layout_children), then shows them. More...
 
const std::vector< std::string > & user_list () const
 
void send_to_server (const config &cfg) override
 
bool receive_from_server (config &dst)
 
plugins_contextget_plugins_context ()
 
- Public Member Functions inherited from gui::widget
SDL_Rect const & location () const
 
void set_location (int x, int y)
 
void set_width (int w)
 
void set_height (int h)
 
void set_measurements (int w, int h)
 
int width () const
 
int height () const
 
bool focus (const SDL_Event *event)
 
void set_focus (bool focus)
 
virtual void hide (bool value=true)
 
bool hidden () const
 
virtual void enable (bool new_val=true)
 
bool enabled () const
 
void set_clip_rect (const SDL_Rect &rect)
 
void set_volatile (bool val=true)
 
void set_dirty (bool dirty=true)
 
bool dirty () const
 
const std::stringid () const
 
void set_id (const std::string &id)
 
void set_help_string (const std::string &str)
 
void set_tooltip_string (const std::string &str)
 
virtual void process_help_string (int mousex, int mousey)
 
virtual void process_tooltip_string (int mousex, int mousey)
 
- Public Member Functions inherited from events::sdl_handler
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
 
virtual void join ()
 
virtual void join (context &c)
 
virtual void join_same (sdl_handler *parent)
 
virtual void leave ()
 
virtual void join_global ()
 
virtual void leave_global ()
 

Protected Member Functions

virtual void layout_children (const SDL_Rect &rect)
 Lays the children out. More...
 
virtual void process_event ()
 
virtual void hide_children (bool hide=true)
 Hides or shows all gui::widget children of this widget. More...
 
- Protected Member Functions inherited from mp::ui
int xscale (int x) const
 
int yscale (int y) const
 
SDL_Rect client_area () const
 
CVideovideo ()
 
const configgame_config () const
 Returns the main game config, as defined by loading the preprocessed WML files. More...
 
virtual void draw_contents ()
 
virtual void handle_event (const SDL_Event &event)
 
virtual void handle_key_event (const SDL_KeyboardEvent &event)
 
void add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &message, events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE)
 Override chat_handler. More...
 
void send_chat_message (const std::string &message, bool allies_only=false)
 
void process_message (const config &msg, const bool whisper=false)
 Process chat messages. More...
 
virtual void process_network_data (const config &data)
 Processes any pending network data. More...
 
result set_result (result res)
 Sets the result of this dialog, to be checked by get_result(). More...
 
void set_selected_game (const std::string &game_name)
 Sets the name of the selected game which is used to highlight the names of the players which have joined this game. More...
 
virtual void gamelist_updated (bool silent=true)
 Called each time the gamelist_ variable is updated. More...
 
void set_user_list (const std::vector< std::string > &, bool silent)
 Sets the user list. More...
 
void set_user_menu_items (const std::vector< std::string > &list)
 
configgamelist ()
 Returns the current gamelist. More...
 
void append_to_title (const std::string &name)
 
const gui::labeltitle () const
 
std::string get_selected_user_game ()
 
bool selected_user_changed () const
 
void set_selected_user_changed (const bool &changed)
 
- Protected Member Functions inherited from gui::widget
 widget (widget const &o)
 
 widget (CVideo &video, const bool auto_join=true)
 
virtual ~widget ()
 
void bg_register (SDL_Rect const &rect)
 
void bg_restore () const
 
void bg_restore (SDL_Rect const &rect) const
 
void bg_update ()
 
void bg_cancel ()
 
CVideovideo () const
 
virtual void draw ()
 
virtual void update_location (SDL_Rect const &rect)
 
const SDL_Rect * clip_rect () const
 
virtual sdl_handler_vector member_handlers ()
 
virtual void handle_window_event (SDL_Event const &event)
 
bool mouse_locked () const
 
void aquire_mouse_lock ()
 
void free_mouse_lock ()
 
- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
virtual ~sdl_handler ()
 
virtual std::vector
< sdl_handler * > 
handler_members ()
 

Private Member Functions

void process_event_impl (const process_event_data &)
 
bool plugin_event_helper (const process_event_data &)
 

Private Attributes

bool local_players_only_
 
tooltips::manager tooltip_manager_
 
int mp_countdown_init_time_
 
int mp_countdown_reservoir_time_
 
gui::button countdown_game_
 
gui::slider countdown_init_time_slider_
 
gui::label countdown_init_time_label_
 
gui::slider countdown_reservoir_time_slider_
 
gui::label countdown_reservoir_time_label_
 
gui::label countdown_turn_bonus_label_
 
gui::slider countdown_turn_bonus_slider_
 
gui::label countdown_action_bonus_label_
 
gui::slider countdown_action_bonus_slider_
 
gui::label name_entry_label_
 
gui::button observers_game_
 
gui::button registered_users_only_
 
gui::button oos_debug_
 
gui::button shuffle_sides_
 
gui::label random_faction_mode_label_
 
gui::combo random_faction_mode_
 
gui::button cancel_game_
 
gui::button launch_game_
 
gui::button password_button_
 
gui::textbox name_entry_
 
gui::label entry_points_label_
 
gui::combo entry_points_combo_
 
gui::scrollpane options_pane_left_
 
gui::scrollpane options_pane_right_
 
std::vector< config const * > entry_points_
 
bool show_entry_points_
 
bool force_use_map_settings_check_
 
saved_gamestate_
 
mp_game_settingsparameters_
 
ng::configure_engine engine_
 
options::manager options_manager_
 
boost::scoped_ptr
< nolock_settings
nolock_settings_
 

Additional Inherited Members

- Public Types inherited from mp::ui
enum  result {
  CONTINUE, JOIN, OBSERVE, CREATE,
  LOAD_GAME, PREFERENCES, PLAY, QUIT
}
 
enum  user_relation { ME, FRIEND, NEUTRAL, IGNORED }
 
enum  user_state { LOBBY, GAME, SEL_GAME }
 
- Protected Attributes inherited from mp::ui
CVideovideo_
 
twesnothd_connectionwesnothd_connection_
 
boost::scoped_ptr
< plugins_context
plugins_context_
 
- Protected Attributes inherited from gui::widget
bool focus_
 
- Static Protected Attributes inherited from mp::ui
static const int xscale_base = 1024
 
static const int yscale_base = 768
 

Detailed Description

Definition at line 32 of file multiplayer_configure.hpp.

Constructor & Destructor Documentation

mp::configure::configure ( CVideo v,
twesnothd_connection wesnothd_connection,
const config game_config,
chat c,
config gamelist,
saved_game game,
bool  local_players_only 
)

gives the user the option to adjust the passed saved_game Call get_parameters to finalize;

Definition at line 65 of file multiplayer_configure.cpp.

References _(), mp_game_settings::active_mods, ng::configure_engine::allow_observers_default(), game_classification::campaign, saved_game::classification(), countdown_action_bonus_slider_, countdown_game_, countdown_init_time_slider_, countdown_reservoir_time_slider_, countdown_turn_bonus_slider_, mp::ui::CREATE, DBG_MP, gui::button::enable(), engine_, ng::configure_engine::entry_point_titles(), entry_points_combo_, ng::configure_engine::fog_game_default(), ng::configure_engine::force_lock_settings(), ng::configure_engine::game_name_default(), mp::ui::gamelist_updated(), saved_game::get_scenario_id(), get_str, translation::gettext(), mp::options::manager::has_options(), i, mp::options::manager::init_widgets(), ng::configure_engine::mp_countdown_action_bonus_default(), ng::configure_engine::mp_countdown_default(), ng::configure_engine::mp_countdown_init_time_default(), ng::configure_engine::mp_countdown_reservoir_time_default(), ng::configure_engine::mp_countdown_turn_bonus_default(), mp_game_settings::mp_era, name_entry_, nolock_settings_, font::NORMAL_COLOR, ng::configure_engine::num_turns_default(), observers_game_, oos_debug_, options_manager_, parameters_, plugin_event_helper(), mp::ui::plugins_context_, ng::configure_engine::random_faction_mode(), random_faction_mode_, random_faction_mode_label_, ng::configure_engine::random_start_time_default(), registered_users_only_, ng::configure_engine::registered_users_only_default(), ng::depcheck::SCENARIO, mp::options::manager::set_campaign(), gui::button::set_check(), mp::options::manager::set_era(), gui::widget::set_help_string(), gui::slider::set_increment(), gui::combo::set_items(), gui::slider::set_max(), gui::slider::set_min(), mp::options::manager::set_modifications(), mp::ui::set_result(), mp::options::manager::set_scenario(), gui::combo::set_selected(), gui::textbox::set_text(), gui::slider::set_value(), show_entry_points_, ng::configure_engine::shroud_game_default(), shuffle_sides_, ng::configure_engine::shuffle_sides_default(), state_, settings::turns_max, settings::turns_min, settings::turns_step, ng::configure_engine::use_map_settings(), ng::configure_engine::village_gold_default(), ng::configure_engine::village_support_default(), and ng::configure_engine::xp_modifier_default().

mp::configure::~configure ( )

Definition at line 248 of file multiplayer_configure.cpp.

References ng::configure_engine::allow_observers(), mp::ui::CREATE, DBG_MP, gui::widget::enabled(), engine_, ng::configure_engine::fog_game(), mp::ui::get_result(), ng::configure_engine::mp_countdown(), ng::configure_engine::mp_countdown_action_bonus(), ng::configure_engine::mp_countdown_init_time(), ng::configure_engine::mp_countdown_reservoir_time(), ng::configure_engine::mp_countdown_turn_bonus(), ng::configure_engine::num_turns(), observers_game_, ng::configure_engine::options(), ng::configure_engine::random_faction_mode(), ng::configure_engine::random_start_time(), ng::configure_engine::registered_users_only(), registered_users_only_, preferences::set_allow_observers(), preferences::set_countdown(), preferences::set_countdown_action_bonus(), preferences::set_countdown_init_time(), preferences::set_countdown_reservoir_time(), preferences::set_countdown_turn_bonus(), preferences::set_fog(), preferences::set_options(), preferences::set_random_faction_mode(), preferences::set_random_start_time(), preferences::set_registered_users_only(), preferences::set_shroud(), preferences::set_shuffle_sides(), preferences::set_turns(), preferences::set_use_map_settings(), preferences::set_village_gold(), preferences::set_village_support(), preferences::set_xp_modifier(), ng::configure_engine::shroud_game(), ng::configure_engine::shuffle_sides(), ng::configure_engine::use_map_settings(), ng::configure_engine::village_gold(), ng::configure_engine::village_support(), and ng::configure_engine::xp_modifier().

Member Function Documentation

void mp::configure::get_parameters ( )

Definition at line 290 of file multiplayer_configure.cpp.

References gui::button::checked(), countdown_action_bonus_slider_, countdown_game_, countdown_init_time_slider_, countdown_reservoir_time_slider_, countdown_turn_bonus_slider_, DBG_MP, engine_, mp::options::manager::get_values(), gui::slider::max_value(), name_entry_, nolock_settings_, observers_game_, oos_debug_, options_manager_, random_faction_mode_, registered_users_only_, gui::combo::selected(), ng::configure_engine::set_allow_observers(), ng::configure_engine::set_fog_game(), ng::configure_engine::set_game_name(), ng::configure_engine::set_mp_countdown(), ng::configure_engine::set_mp_countdown_action_bonus(), ng::configure_engine::set_mp_countdown_init_time(), ng::configure_engine::set_mp_countdown_reservoir_time(), ng::configure_engine::set_mp_countdown_turn_bonus(), ng::configure_engine::set_num_turns(), ng::configure_engine::set_oos_debug(), ng::configure_engine::set_options(), ng::configure_engine::set_random_faction_mode(), ng::configure_engine::set_random_start_time(), ng::configure_engine::set_registered_users_only(), ng::configure_engine::set_shroud_game(), ng::configure_engine::set_shuffle_sides(), ng::configure_engine::set_use_map_settings(), ng::configure_engine::set_village_gold(), ng::configure_engine::set_village_support(), ng::configure_engine::set_xp_modifier(), shuffle_sides_, gui::textbox::text(), gui::slider::value(), and ng::configure_engine::write_parameters().

Referenced by sp::enter_configure_mode(), and enter_configure_mode().

void mp::configure::hide_children ( bool  hide = true)
protectedvirtual
void mp::configure::layout_children ( const SDL_Rect &  rect)
protectedvirtual
bool mp::configure::plugin_event_helper ( const process_event_data data)
private

Definition at line 338 of file multiplayer_configure.cpp.

References mp::ui::CONTINUE, mp::ui::get_result(), and process_event_impl().

Referenced by configure().

void mp::configure::process_event ( )
protectedvirtual
void mp::configure::process_event_impl ( const process_event_data data)
private

Definition at line 357 of file multiplayer_configure.cpp.

References _(), gui::combo::changed(), gui::button::checked(), countdown_action_bonus_label_, countdown_action_bonus_slider_, countdown_game_, countdown_init_time_label_, countdown_init_time_slider_, countdown_reservoir_time_label_, countdown_reservoir_time_slider_, countdown_turn_bonus_label_, countdown_turn_bonus_slider_, mp::ui::CREATE, gui::slider::enable(), gui::widget::enable(), engine_, entry_points_combo_, gui2::tmp_create_game_set_password::execute(), ng::configure_engine::fog_game_default(), force_use_map_settings_check_, mp::configure::process_event_data::launch, mp_countdown_init_time_, mp_countdown_reservoir_time_, name_entry_, nolock_settings_, ng::configure_engine::num_turns_default(), options_manager_, parameters_, mp_game_settings::password, password_button_, gui::button::pressed(), mp::options::manager::process_event(), mp::ui::QUIT, mp::configure::process_event_data::quit, ng::configure_engine::random_start_time_default(), gui::combo::selected(), mp::ui::set_result(), ng::configure_engine::set_scenario(), gui::label::set_text(), ng::configure_engine::set_use_map_settings(), gui::slider::set_value(), gui2::show_transient_message(), ng::configure_engine::shroud_game_default(), gui::textbox::text(), ng::configure_engine::use_map_settings(), gui::slider::value(), mp::ui::video(), preferences::village_gold(), ng::configure_engine::village_gold_default(), game_config::village_support, ng::configure_engine::village_support_default(), and ng::configure_engine::xp_modifier_default().

Referenced by plugin_event_helper(), and process_event().

Member Data Documentation

gui::button mp::configure::cancel_game_
private

Definition at line 90 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event().

gui::label mp::configure::countdown_action_bonus_label_
private

Definition at line 79 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event_impl().

gui::slider mp::configure::countdown_action_bonus_slider_
private
gui::button mp::configure::countdown_game_
private
gui::label mp::configure::countdown_init_time_label_
private

Definition at line 74 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event_impl().

gui::slider mp::configure::countdown_init_time_slider_
private
gui::label mp::configure::countdown_reservoir_time_label_
private

Definition at line 76 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event_impl().

gui::slider mp::configure::countdown_reservoir_time_slider_
private
gui::label mp::configure::countdown_turn_bonus_label_
private

Definition at line 77 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event_impl().

gui::slider mp::configure::countdown_turn_bonus_slider_
private
ng::configure_engine mp::configure::engine_
private
std::vector<config const*> mp::configure::entry_points_
private

Definition at line 102 of file multiplayer_configure.hpp.

gui::combo mp::configure::entry_points_combo_
private
gui::label mp::configure::entry_points_label_
private

Definition at line 96 of file multiplayer_configure.hpp.

Referenced by hide_children(), and layout_children().

bool mp::configure::force_use_map_settings_check_
private

Definition at line 105 of file multiplayer_configure.hpp.

Referenced by process_event_impl().

gui::button mp::configure::launch_game_
private

Definition at line 91 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event().

bool mp::configure::local_players_only_
private

Definition at line 66 of file multiplayer_configure.hpp.

Referenced by layout_children().

int mp::configure::mp_countdown_init_time_
private

Definition at line 69 of file multiplayer_configure.hpp.

Referenced by process_event_impl().

int mp::configure::mp_countdown_reservoir_time_
private

Definition at line 70 of file multiplayer_configure.hpp.

Referenced by process_event_impl().

gui::textbox mp::configure::name_entry_
private
gui::label mp::configure::name_entry_label_
private

Definition at line 82 of file multiplayer_configure.hpp.

Referenced by hide_children(), and layout_children().

boost::scoped_ptr<nolock_settings> mp::configure::nolock_settings_
private
gui::button mp::configure::observers_game_
private
gui::button mp::configure::oos_debug_
private
options::manager mp::configure::options_manager_
private
gui::scrollpane mp::configure::options_pane_left_
private

Definition at line 99 of file multiplayer_configure.hpp.

Referenced by hide_children(), and layout_children().

gui::scrollpane mp::configure::options_pane_right_
private

Definition at line 100 of file multiplayer_configure.hpp.

Referenced by hide_children(), and layout_children().

mp_game_settings& mp::configure::parameters_
private

Definition at line 107 of file multiplayer_configure.hpp.

Referenced by configure(), and process_event_impl().

gui::button mp::configure::password_button_
private

Definition at line 92 of file multiplayer_configure.hpp.

Referenced by hide_children(), layout_children(), and process_event_impl().

gui::combo mp::configure::random_faction_mode_
private
gui::label mp::configure::random_faction_mode_label_
private

Definition at line 87 of file multiplayer_configure.hpp.

Referenced by configure(), hide_children(), and layout_children().

gui::button mp::configure::registered_users_only_
private
bool mp::configure::show_entry_points_
private

Definition at line 103 of file multiplayer_configure.hpp.

Referenced by configure(), and layout_children().

gui::button mp::configure::shuffle_sides_
private
saved_game& mp::configure::state_
private

Definition at line 106 of file multiplayer_configure.hpp.

Referenced by configure().

tooltips::manager mp::configure::tooltip_manager_
private

Definition at line 68 of file multiplayer_configure.hpp.


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