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::create Class Reference

#include <multiplayer_create.hpp>

Inheritance diagram for mp::create:
Inheritance graph

Classes

struct  process_event_data
 

Public Member Functions

 create (CVideo &v, twesnothd_connection *wesnothd_connection, const config &game_config, saved_game &state, chat &c, config &gamelist)
 
 ~create ()
 
const mp_game_settingsget_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 init_level_type_changed (size_t index)
 
void init_level_changed (size_t index)
 
void synchronize_selections ()
 
void draw_level_image ()
 
void set_description (const std::string &description)
 
void update_mod_menu ()
 
std::string select_campaign_difficulty ()
 
void process_event_impl (const process_event_data &)
 
bool plugin_event_helper (const process_event_data &)
 
void select_level_type_helper (const std::string &str)
 

Private Attributes

tooltips::manager tooltip_manager_
 
int era_selection_
 
int mod_selection_
 
int level_selection_
 
gui::menu eras_menu_
 
gui::menu levels_menu_
 
gui::multimenu mods_menu_
 
gui::label filter_name_label_
 
gui::label filter_num_players_label_
 
gui::label map_generator_label_
 
gui::label era_label_
 
gui::label no_era_label_
 
gui::label mod_label_
 
gui::label map_size_label_
 
gui::label num_players_label_
 
gui::label level_type_label_
 
gui::button launch_game_
 
gui::button cancel_game_
 
gui::button regenerate_map_
 
gui::button generator_settings_
 
gui::button load_game_
 
gui::combo level_type_combo_
 
gui::slider filter_num_players_slider_
 
gui::textbox description_
 
gui::textbox filter_name_
 
util::scoped_ptr
< surface_restorer
image_restorer_
 
SDL_Rect image_rect_
 
std::vector< ng::level::TYPE > available_level_types_
 
ng::create_engine engine_
 

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 30 of file multiplayer_create.hpp.

Constructor & Destructor Documentation

mp::create::create ( CVideo v,
twesnothd_connection wesnothd_connection,
const config game_config,
saved_game state,
chat c,
config gamelist 
)
mp::create::~create ( )

Member Function Documentation

void mp::create::draw_level_image ( )
private
const mp_game_settings & mp::create::get_parameters ( )

Definition at line 249 of file multiplayer_create.cpp.

References engine_, and ng::create_engine::get_parameters().

Referenced by enter_create_mode().

void mp::create::hide_children ( bool  hide = true)
protectedvirtual
void mp::create::init_level_changed ( size_t  index)
private
void mp::create::init_level_type_changed ( size_t  index)
private
void mp::create::layout_children ( const SDL_Rect &  rect)
protectedvirtual
bool mp::create::plugin_event_helper ( const process_event_data data)
private

Definition at line 254 of file multiplayer_create.cpp.

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

Referenced by create().

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

Definition at line 274 of file multiplayer_create.cpp.

References _(), ng::create_engine::apply_level_filter(), saved_game::cancel_orders(), gui::combo::changed(), mp::ui::CREATE, mp::create::process_event_data::create, ng::create_engine::current_extra(), ng::create_engine::current_level(), ng::create_engine::current_level_type(), ng::level::data(), ng::level::description(), ng::create_engine::extras_metadata::description, draw_level_image(), config::empty(), gui::button::enable(), engine_, ng::create_engine::ERA, era_selection_, eras_menu_, mp::create::process_event_data::filename, filter_name_, filter_num_players_label_, filter_num_players_slider_, mp::ui::game_config(), ng::create_engine::generator_assigned(), generator_settings_, ng::create_engine::generator_user_config(), game_config_manager::get(), ng::create_engine::get_state(), ng::create_engine::init_generated_level_data(), init_level_changed(), init_level_type_changed(), gui::multimenu::last_changed(), launch_game_, ng::create_engine::level_name_filter(), level_selection_, level_type_combo_, levels_menu_, mp::create::process_event_data::load, floating_point_emulation::detail::load(), mp::ui::LOAD_GAME, ng::scenario::map_size(), map_size_label_, ng::campaign::max_players(), ng::campaign::min_players(), ng::create_engine::MOD, mod_selection_, mods_menu_, ng::scenario::num_players(), num_players_label_, ng::create_engine::player_num_filter(), ng::create_engine::prepare_for_campaign(), ng::create_engine::prepare_for_era_and_mods(), ng::create_engine::prepare_for_new_level(), ng::create_engine::prepare_for_other(), ng::create_engine::prepare_for_saved_game(), ng::create_engine::prepare_for_scenario(), gui::button::pressed(), mp::ui::QUIT, mp::create::process_event_data::quit, regenerate_map_, ng::depcheck::SCENARIO, ng::create_engine::select_campaign_difficulty(), gui::menu::selection(), ng::create_engine::set_current_era_index(), ng::create_engine::set_current_mod_index(), set_description(), ng::level::set_metadata(), mp::ui::set_result(), gui::label::set_text(), gui2::show_message(), gui2::show_transient_message(), synchronize_selections(), gui::textbox::text(), ng::create_engine::toggle_current_mod(), gui::slider::value(), mp::ui::video(), and cursor::WAIT.

Referenced by plugin_event_helper(), process_event(), and select_level_type_helper().

std::string mp::create::select_campaign_difficulty ( )
private
void mp::create::select_level_type_helper ( const std::string str)
private
void mp::create::set_description ( const std::string description)
private

Definition at line 570 of file multiplayer_create.cpp.

References _(), description_, and gui::textbox::set_text().

Referenced by process_event_impl().

void mp::create::synchronize_selections ( )
private
void mp::create::update_mod_menu ( )
private

Member Data Documentation

std::vector<ng::level::TYPE> mp::create::available_level_types_
private
gui::button mp::create::cancel_game_
private

Definition at line 78 of file multiplayer_create.hpp.

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

gui::textbox mp::create::description_
private

Definition at line 87 of file multiplayer_create.hpp.

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

ng::create_engine mp::create::engine_
private
gui::label mp::create::era_label_
private

Definition at line 70 of file multiplayer_create.hpp.

Referenced by hide_children(), and layout_children().

int mp::create::era_selection_
private

Definition at line 59 of file multiplayer_create.hpp.

Referenced by process_event_impl(), and synchronize_selections().

gui::menu mp::create::eras_menu_
private
gui::textbox mp::create::filter_name_
private

Definition at line 88 of file multiplayer_create.hpp.

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

gui::label mp::create::filter_name_label_
private

Definition at line 67 of file multiplayer_create.hpp.

Referenced by layout_children().

gui::label mp::create::filter_num_players_label_
private

Definition at line 68 of file multiplayer_create.hpp.

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

gui::slider mp::create::filter_num_players_slider_
private

Definition at line 85 of file multiplayer_create.hpp.

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

gui::button mp::create::generator_settings_
private

Definition at line 80 of file multiplayer_create.hpp.

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

SDL_Rect mp::create::image_rect_
private

Definition at line 91 of file multiplayer_create.hpp.

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

util::scoped_ptr<surface_restorer> mp::create::image_restorer_
private

Definition at line 90 of file multiplayer_create.hpp.

Referenced by hide_children().

gui::button mp::create::launch_game_
private
int mp::create::level_selection_
private

Definition at line 61 of file multiplayer_create.hpp.

Referenced by init_level_type_changed(), and process_event_impl().

gui::combo mp::create::level_type_combo_
private
gui::label mp::create::level_type_label_
private

Definition at line 75 of file multiplayer_create.hpp.

Referenced by hide_children(), and layout_children().

gui::menu mp::create::levels_menu_
private
gui::button mp::create::load_game_
private

Definition at line 81 of file multiplayer_create.hpp.

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

gui::label mp::create::map_generator_label_
private

Definition at line 69 of file multiplayer_create.hpp.

Referenced by hide_children(), and layout_children().

gui::label mp::create::map_size_label_
private

Definition at line 73 of file multiplayer_create.hpp.

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

gui::label mp::create::mod_label_
private

Definition at line 72 of file multiplayer_create.hpp.

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

int mp::create::mod_selection_
private

Definition at line 60 of file multiplayer_create.hpp.

Referenced by create(), and process_event_impl().

gui::multimenu mp::create::mods_menu_
private
gui::label mp::create::no_era_label_
private

Definition at line 71 of file multiplayer_create.hpp.

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

gui::label mp::create::num_players_label_
private

Definition at line 74 of file multiplayer_create.hpp.

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

gui::button mp::create::regenerate_map_
private

Definition at line 79 of file multiplayer_create.hpp.

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

tooltips::manager mp::create::tooltip_manager_
private

Definition at line 58 of file multiplayer_create.hpp.


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