#include <multiplayer_create.hpp>
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_settings & | 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_context * | get_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::string & | id () 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 |
CVideo & | video () |
const config & | game_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) |
config & | gamelist () |
Returns the current gamelist. More... | |
void | append_to_title (const std::string &name) |
const gui::label & | title () 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 () |
CVideo & | video () 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) |
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 | |
CVideo & | video_ |
twesnothd_connection * | wesnothd_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 |
Definition at line 30 of file multiplayer_create.hpp.
mp::create::create | ( | CVideo & | v, |
twesnothd_connection * | wesnothd_connection, | ||
const config & | game_config, | ||
saved_game & | state, | ||
chat & | c, | ||
config & | gamelist | ||
) |
Definition at line 85 of file multiplayer_create.cpp.
References _(), available_level_types_, DBG_MP, game_config::debug, engine_, ng::create_engine::ERA, preferences::era(), eras_menu_, error(), ng::create_engine::extras_menu_item_names(), filter_num_players_slider_, ng::create_engine::find_extra_by_id(), mp::find_helper(), ng::create_engine::find_level_by_id(), mp::ui::game_config(), mp::ui::gamelist_updated(), ng::create_engine::get_levels_by_type_unfiltered(), mp::get_selected_helper(), get_size_t, get_str, init_level_type_changed(), preferences::level(), preferences::level_type(), level_type_combo_, levels_menu_, ng::create_engine::MOD, mod_label_, mod_selection_, mods_menu_, gui::menu::move_selection(), plugin_event_helper(), mp::ui::plugins_context_, ng::depcheck::SCENARIO, select_level_type_helper(), gui::menu::selection(), mp::ui::send_chat_message(), gui::slider::set_increment(), gui::combo::set_items(), gui::multimenu::set_items(), gui::menu::set_items(), gui::slider::set_max(), gui::slider::set_min(), gui::menu::set_numeric_keypress_selection(), gui::combo::set_selected(), gui::label::set_text(), and gui2::show_transient_message().
mp::create::~create | ( | ) |
Definition at line 230 of file multiplayer_create.cpp.
References ng::create_engine::active_mods(), mp::ui::CREATE, ng::create_engine::current_extra(), ng::create_engine::current_level(), ng::create_engine::current_level_type(), DBG_MP, engine_, ng::create_engine::ERA, mp::ui::get_result(), ng::level::id(), ng::create_engine::extras_metadata::id, preferences::set_era(), preferences::set_level(), preferences::set_level_type(), and preferences::set_modifications().
|
private |
Definition at line 553 of file multiplayer_create.cpp.
References ng::level::create_image_surface(), ng::create_engine::current_level(), draw_centered_on_background(), engine_, sdl::fill_rect(), image_rect_, update_rect(), and mp::ui::video().
Referenced by hide_children(), and process_event_impl().
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().
|
protectedvirtual |
Hides or shows all gui::widget children of this widget.
Should be overridden by subclasses which add their own children.
Reimplemented from mp::ui.
Definition at line 583 of file multiplayer_create.cpp.
References ng::level::allow_era_choice(), util::scoped_resource< T, ReleasePolicy >::assign(), cancel_game_, ng::create_engine::current_level(), DBG_MP, description_, draw_level_image(), engine_, era_label_, eras_menu_, filter_name_, filter_num_players_label_, filter_num_players_slider_, generator_settings_, gui::scrollarea::hide(), gui::widget::hide(), mp::ui::hide_children(), image_rect_, image_restorer_, launch_game_, level_type_combo_, level_type_label_, levels_menu_, load_game_, map_generator_label_, map_size_label_, mod_label_, mods_menu_, no_era_label_, num_players_label_, regenerate_map_, ng::level::set_metadata(), and mp::ui::video().
|
private |
Definition at line 492 of file multiplayer_create.cpp.
References ng::level::allow_era_choice(), ng::create_engine::current_level(), engine_, eras_menu_, gui::scrollarea::hide(), gui::widget::hide(), no_era_label_, and ng::create_engine::set_current_level().
Referenced by init_level_type_changed(), process_event_impl(), and synchronize_selections().
|
private |
Definition at line 473 of file multiplayer_create.cpp.
References available_level_types_, engine_, init_level_changed(), level_selection_, level_type_combo_, levels_menu_, ng::create_engine::levels_menu_item_names(), gui::menu::move_selection(), gui::combo::selected(), game_config::images::selected, ng::create_engine::set_current_level_type(), and gui::menu::set_items().
Referenced by create(), process_event_impl(), and select_level_type_helper().
|
protectedvirtual |
Lays the children out.
This method is to be overridden by the subclasses of the mp_ui class; it will be called.
Reimplemented from mp::ui.
Definition at line 628 of file multiplayer_create.cpp.
References gui::ButtonHPadding, cancel_game_, mp::ui::client_area(), sdl::create_rect(), DBG_MP, description_, engine_, ng::create_engine::ERA, era_label_, eras_menu_, ng::create_engine::extras_menu_item_names(), filter_name_, filter_name_label_, filter_num_players_label_, filter_num_players_slider_, generator_settings_, gui::widget::height(), image_rect_, help::image_width(), launch_game_, mp::ui::layout_children(), level_type_combo_, level_type_label_, levels_menu_, ng::create_engine::levels_menu_item_names(), load_game_, gui::widget::location(), map_generator_label_, map_size_label_, mod_label_, mods_menu_, gui::menu::move_selection(), no_era_label_, num_players_label_, gui::menu::number_of_items(), regenerate_map_, gui::menu::selection(), gui::menu::set_items(), gui::widget::set_location(), gui::slider::set_location(), gui::menu::set_max_height(), gui::menu::set_max_width(), gui::widget::set_measurements(), gui::widget::set_width(), gui::textbox::set_wrap(), swap(), mp::ui::title(), and gui::widget::width().
|
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().
|
protectedvirtual |
Reimplemented from mp::ui.
Definition at line 260 of file multiplayer_create.cpp.
References cancel_game_, mp::create::process_event_data::create, gui::menu::double_clicked(), launch_game_, levels_menu_, mp::create::process_event_data::load, load_game_, gui::button::pressed(), tooltips::process(), process_event_impl(), and mp::create::process_event_data::quit.
Referenced by synchronize_selections().
|
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().
|
private |
|
private |
Definition at line 219 of file multiplayer_create.cpp.
References available_level_types_, init_level_type_changed(), level_type_combo_, process_event_impl(), and gui::combo::set_selected().
Referenced by create().
|
private |
Definition at line 570 of file multiplayer_create.cpp.
References _(), description_, and gui::textbox::set_text().
Referenced by process_event_impl().
|
private |
Definition at line 507 of file multiplayer_create.cpp.
References available_level_types_, ng::create_engine::current_level(), ng::create_engine::current_level_type(), DBG_MP, ng::create_engine::dependency_manager(), engine_, era_selection_, eras_menu_, ng::create_engine::find_level_by_id(), ng::create_engine::find_level_type_by_id(), ng::level::id(), ng::create_engine::init_active_mods(), init_level_changed(), level_type_combo_, levels_menu_, ng::create_engine::levels_menu_item_names(), gui::menu::move_selection(), process_event(), ng::create_engine::set_current_level_type(), gui::menu::set_items(), gui::combo::set_selected(), and update_mod_menu().
Referenced by process_event_impl().
|
private |
Definition at line 576 of file multiplayer_create.cpp.
References ng::create_engine::dependency_manager(), engine_, i, mods_menu_, gui::menu::number_of_items(), and gui::multimenu::set_active().
Referenced by synchronize_selections().
|
private |
Definition at line 93 of file multiplayer_create.hpp.
Referenced by create(), init_level_type_changed(), select_level_type_helper(), and synchronize_selections().
|
private |
Definition at line 78 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event().
|
private |
Definition at line 87 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and set_description().
|
private |
Definition at line 95 of file multiplayer_create.hpp.
Referenced by create(), draw_level_image(), get_parameters(), hide_children(), init_level_changed(), init_level_type_changed(), layout_children(), process_event_impl(), synchronize_selections(), update_mod_menu(), and ~create().
|
private |
Definition at line 70 of file multiplayer_create.hpp.
Referenced by hide_children(), and layout_children().
|
private |
Definition at line 59 of file multiplayer_create.hpp.
Referenced by process_event_impl(), and synchronize_selections().
|
private |
Definition at line 63 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), init_level_changed(), layout_children(), process_event_impl(), and synchronize_selections().
|
private |
Definition at line 88 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 67 of file multiplayer_create.hpp.
Referenced by layout_children().
|
private |
Definition at line 68 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 85 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 80 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 91 of file multiplayer_create.hpp.
Referenced by draw_level_image(), hide_children(), and layout_children().
|
private |
Definition at line 90 of file multiplayer_create.hpp.
Referenced by hide_children().
|
private |
Definition at line 77 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), process_event(), and process_event_impl().
|
private |
Definition at line 61 of file multiplayer_create.hpp.
Referenced by init_level_type_changed(), and process_event_impl().
|
private |
Definition at line 83 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), init_level_type_changed(), layout_children(), process_event_impl(), select_level_type_helper(), and synchronize_selections().
|
private |
Definition at line 75 of file multiplayer_create.hpp.
Referenced by hide_children(), and layout_children().
|
private |
Definition at line 64 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), init_level_type_changed(), layout_children(), process_event(), process_event_impl(), and synchronize_selections().
|
private |
Definition at line 81 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event().
|
private |
Definition at line 69 of file multiplayer_create.hpp.
Referenced by hide_children(), and layout_children().
|
private |
Definition at line 73 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 72 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), and layout_children().
|
private |
Definition at line 60 of file multiplayer_create.hpp.
Referenced by create(), and process_event_impl().
|
private |
Definition at line 65 of file multiplayer_create.hpp.
Referenced by create(), hide_children(), layout_children(), process_event_impl(), and update_mod_menu().
|
private |
Definition at line 71 of file multiplayer_create.hpp.
Referenced by hide_children(), init_level_changed(), and layout_children().
|
private |
Definition at line 74 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 79 of file multiplayer_create.hpp.
Referenced by hide_children(), layout_children(), and process_event_impl().
|
private |
Definition at line 58 of file multiplayer_create.hpp.