#include <multiplayer_wait.hpp>
Classes | |
class | leader_preview_pane |
Public Member Functions | |
wait (CVideo &v, twesnothd_connection *wesnothd_connection, const config &cfg, saved_game &state, chat &c, config &gamelist, const bool first_scenario=true) | |
~wait () | |
virtual void | process_event () |
void | join_game (bool observe) |
void | start_game () |
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 | hide_children (bool hide=true) |
Hides or shows all gui::widget children of this widget. More... | |
virtual void | process_network_data (const config &data) |
Processes any pending network data. 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... | |
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 | generate_menu () |
bool | download_level_data () |
config & | get_scenario () |
const config & | get_scenario () const |
void | process_event_impl (bool) |
Private Attributes | |
gui::button | cancel_button_ |
gui::label | start_label_ |
gui::menu | game_menu_ |
config | level_ |
saved_game & | state_ |
const bool | first_scenario_ |
bool | stop_updates_ |
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 24 of file multiplayer_wait.hpp.
mp::wait::wait | ( | CVideo & | v, |
twesnothd_connection * | wesnothd_connection, | ||
const config & | cfg, | ||
saved_game & | state, | ||
mp::chat & | c, | ||
config & | gamelist, | ||
const bool | first_scenario = true |
||
) |
Definition at line 196 of file multiplayer_wait.cpp.
References game_menu_, mp::ui::gamelist_updated(), get_str, mp::ui::plugins_context_, process_event_impl(), mp::ui::send_chat_message(), and gui::menu::set_numeric_keypress_selection().
mp::wait::~wait | ( | ) |
Definition at line 217 of file multiplayer_wait.cpp.
References saved_game::classification(), mp::ui::get_result(), mp::ui::QUIT, and state_.
|
private |
Definition at line 619 of file multiplayer_wait.cpp.
References _(), mp::check_response(), config::child(), DBG_MP, first_scenario_, get_scenario(), config::has_attribute(), level_, dialogs::network_receive_dialog(), mp::ui::send_to_server(), config::swap(), mp::ui::video(), and mp::ui::wesnothd_connection_.
Referenced by join_game().
|
private |
Definition at line 514 of file multiplayer_wait.cpp.
References _(), _n(), config::child_range(), COLUMN_SEPARATOR, unit_type_data::find(), unit_type::flag_rgb(), t_string::from_serialized(), game_menu_, mp::ui::gamelist(), mp::generate_user_description(), mp::get_color_string(), unit_type::get_gender_unit_type(), get_scenario(), font::IMAGE, unit_type::image(), IMAGE_PREFIX, ng::random_enemy_picture(), gui::menu::set_items(), mp::ui::set_user_list(), t_string::size(), stop_updates_, t_string::str(), unit_type::type_name(), and unit_types.
Referenced by join_game(), and process_network_data().
|
private |
Definition at line 666 of file multiplayer_wait.cpp.
References config::child(), and level_.
Referenced by download_level_data(), generate_menu(), join_game(), and process_network_data().
|
private |
Definition at line 677 of file multiplayer_wait.cpp.
References config::child(), and level_.
|
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 424 of file multiplayer_wait.cpp.
References cancel_button_, game_menu_, gui::scrollarea::hide(), gui::widget::hide(), and mp::ui::hide_children().
void mp::wait::join_game | ( | bool | observe | ) |
Definition at line 239 of file multiplayer_wait.cpp.
References _(), config::add_child(), game_config::add_color_info(), mp::ui::append_to_title(), config::child(), config::child_range(), ng::flg_manager::choosable_factions(), saved_game::classification(), COLUMN_SEPARATOR, ng::flg_manager::current_faction(), ng::flg_manager::current_gender(), ng::flg_manager::current_leader(), DBG_MP, download_level_data(), preferences::era(), ERR_MP, error(), first_scenario_, generate_menu(), game_config_manager::get(), get_scenario(), IMAGE_PREFIX, game_classification::is_normal_mp_game(), level_, game_config_manager::load_game_config_for_game(), preferences::login(), gui::OK_CANCEL, mp::ui::PLAY, mp::ui::QUIT, mp::ui::send_to_server(), mp::ui::set_result(), gui::show_dialog(), state_, preferences::use_map_settings(), and mp::ui::video().
Referenced by enter_wait_mode(), and mp::goto_mp_wait().
|
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 408 of file multiplayer_wait.cpp.
References gui::ButtonVPadding, cancel_button_, mp::ui::client_area(), game_menu_, gui::widget::height(), mp::ui::layout_children(), gui::widget::set_location(), gui::menu::set_max_height(), gui::menu::set_max_width(), gui::widget::set_measurements(), start_label_, mp::ui::title(), and gui::widget::width().
|
virtual |
Reimplemented from mp::ui.
Definition at line 227 of file multiplayer_wait.cpp.
References cancel_button_, gui::button::pressed(), and process_event_impl().
|
private |
Definition at line 232 of file multiplayer_wait.cpp.
References mp::ui::QUIT, and mp::ui::set_result().
Referenced by process_event(), and wait().
Processes any pending network data.
Called by the public process_network() method. Overridden by subclasses who add more behavior for network.
Reimplemented from mp::ui.
Definition at line 432 of file multiplayer_wait.cpp.
References _(), config::apply_diff(), config::child(), config::child_count(), config::debug(), first_scenario_, generate_menu(), get_scenario(), config::has_child(), level_, LOG_NW, LOG_RG, mp::ui::PLAY, mp::ui::process_network_data(), mp::ui::QUIT, mp::ui::set_result(), gui2::show_transient_message(), stop_updates_, and mp::ui::video().
void mp::wait::start_game | ( | ) |
Definition at line 396 of file multiplayer_wait.cpp.
References config::child(), statistics::fresh_stats(), mp_ui_alerts::game_has_begun(), level_, mp::level_to_gamestate(), LOG_NW, statistics::read_stats(), and state_.
Referenced by enter_wait_mode(), and mp::goto_mp_wait().
|
private |
Definition at line 71 of file multiplayer_wait.hpp.
Referenced by hide_children(), layout_children(), and process_event().
|
private |
Definition at line 78 of file multiplayer_wait.hpp.
Referenced by download_level_data(), join_game(), and process_network_data().
|
private |
Definition at line 73 of file multiplayer_wait.hpp.
Referenced by generate_menu(), hide_children(), layout_children(), and wait().
|
private |
Definition at line 75 of file multiplayer_wait.hpp.
Referenced by download_level_data(), get_scenario(), join_game(), process_network_data(), and start_game().
|
private |
Definition at line 72 of file multiplayer_wait.hpp.
Referenced by layout_children().
|
private |
Definition at line 76 of file multiplayer_wait.hpp.
Referenced by join_game(), start_game(), and ~wait().
|
private |
Definition at line 79 of file multiplayer_wait.hpp.
Referenced by generate_menu(), and process_network_data().