#include <lobby.hpp>
Public Member Functions | |
tlobby_main (const config &game_config, lobby_info &info, CVideo &video, twesnothd_connection &wesnothd_connection) | |
~tlobby_main () | |
void | set_preferences_callback (std::function< void()> f) |
Set the callback used to show the preferences. More... | |
void | update_gamelist () |
void | send_to_server (const config &cfg) override |
void | update_playerlist () |
legacy_result | get_legacy_result () const |
void | do_notify (t_notify_mode mode) |
void | do_notify (t_notify_mode mode, const std::string &sender, const std::string &message) |
Public Member Functions inherited from gui2::tdialog | |
tdialog () | |
virtual | ~tdialog () |
bool | show (CVideo &video, const unsigned auto_close_time=0) |
Shows the window. More... | |
int | get_retval () const |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
Protected Member Functions | |
void | update_gamelist_header () |
void | update_gamelist_diff () |
void | update_gamelist_filter () |
std::map< std::string, string_map > | make_game_row_data (const game_info &game) |
void | adjust_game_row_contents (const game_info &game, int idx, tgrid *grid) |
virtual void | send_chat_message (const std::string &message, bool) |
inherited form chat_handler More... | |
virtual void | user_relation_changed (const std::string &name) |
Called when a processed command results in a relation (friend/ignore) change for a user whose name is passed as the 'name' arg. More... | |
virtual 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) |
inherited form chat_handler More... | |
virtual void | add_whisper_sent (const std::string &receiver, const std::string &message) |
inherited form chat_handler More... | |
virtual void | add_whisper_received (const std::string &sender, const std::string &message) |
inherited form chat_handler More... | |
virtual void | add_chat_room_message_sent (const std::string &room, const std::string &message) |
inherited form chat_handler More... | |
virtual void | add_chat_room_message_received (const std::string &room, const std::string &speaker, const std::string &message) |
inherited form chat_handler More... | |
Protected Member Functions inherited from gui2::tdialog | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>()) |
Creates a new integer field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
Registers a new control as a label. More... | |
tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new control as image. More... | |
Private Member Functions | |
void | update_selected_game () |
void | append_to_chatbox (const std::string &text, const bool force_scroll=false) |
Append some text to the active chat log. More... | |
void | append_to_chatbox (const std::string &text, size_t id, const bool force_scroll=false) |
Append some text to the chat log for window "id". More... | |
room_info * | active_window_room () |
Get the room* corresponding to the currently active window, or nullptr if a whisper window is active at the moment. More... | |
tlobby_chat_window * | room_window_open (const std::string &room, bool open_new) |
Check if a room window for "room" is open, if open_new is true then it will be created if not found. More... | |
tlobby_chat_window * | whisper_window_open (const std::string &name, bool open_new) |
Check if a whisper window for user "name" is open, if open_new is true then it will be created if not found. More... | |
tlobby_chat_window * | search_create_window (const std::string &name, bool whisper, bool open_new) |
Helper function to find and open a new window, used by *_window_open. More... | |
bool | whisper_window_active (const std::string &name) |
bool | room_window_active (const std::string &room) |
void | increment_waiting_whsipers (const std::string &name) |
Mark the whisper window for "name" as having one more pending message. More... | |
void | increment_waiting_messages (const std::string &room) |
Mark the room window for "room" as having one more pending message. More... | |
void | add_whisper_window_whisper (const std::string &sender, const std::string &message) |
Add a whisper message to the whisper window. More... | |
void | add_active_window_whisper (const std::string &sender, const std::string &message, const bool force_scroll=false) |
Add a whisper message to the current window which is not the whisper window for "name". More... | |
void | add_room_window_message (const std::string &room, const std::string &sender, const std::string &message) |
Add a message to the window for room "room". More... | |
void | add_active_window_message (const std::string &sender, const std::string &message, const bool force_scroll=false) |
Add a message to the window for room "room". More... | |
void | switch_to_window (tlobby_chat_window *t) |
Switch to the window given by a valid pointer (e.g. More... | |
void | switch_to_window (size_t id) |
void | active_window_changed () |
void | close_active_window () |
void | close_window (size_t idx) |
void | network_handler () |
Network polling callback. More... | |
void | process_network_data (const config &data) |
void | process_message (const config &data, bool whisper=false) |
void | process_gamelist (const config &data) |
void | process_gamelist_diff (const config &data) |
void | process_room_join (const config &data) |
void | process_room_part (const config &data) |
void | process_room_query_response (const config &data) |
void | join_button_callback (twindow &window) |
void | observe_button_callback (twindow &window) |
void | join_global_button_callback (twindow &window) |
void | observe_global_button_callback (twindow &window) |
void | join_or_observe (int index) |
bool | do_game_join (int idx, bool observe) |
Assemble and send a game join request. More... | |
void | send_message_button_callback (twindow &window) |
void | send_message_to_active_window (const std::string &input) |
void | close_window_button_callback (size_t idx) |
void | create_button_callback (twindow &window) |
void | show_preferences_button_callback (twindow &window) |
void | refresh_button_callback (twindow &window) |
void | quit_button_callback (twindow &window) |
void | room_switch_callback (twindow &window) |
void | chat_input_keypress_callback (bool &handled, bool &halt, const SDLKey key, twindow &window) |
void | game_filter_reload () |
void | game_filter_change_callback (twidget &widget) |
void | game_filter_keypress_callback (const SDLKey key) |
void | gamelist_change_callback (twindow &window) |
void | player_filter_callback (twidget &widget) |
void | user_dialog_callback (user_info *info) |
void | skip_replay_changed_callback (twidget &w) |
virtual const std::string & | window_id () const |
Inherited from tdialog, implemented by REGISTER_DIALOG. More... | |
virtual void | post_build (twindow &window) |
Inherited from tdialog. More... | |
void | pre_show (twindow &window) |
Inherited from tdialog. More... | |
void | post_show (twindow &window) |
Inherited from tdialog. More... | |
Private Member Functions inherited from events::chat_handler | |
chat_handler () | |
virtual | ~chat_handler () |
void | send_command (const std::string &cmd, const std::string &args="") |
void | do_speak (const std::string &message, bool allies_only=false) |
virtual void | send_whisper (const std::string &receiver, const std::string &message) |
virtual void | send_chat_room_message (const std::string &room, const std::string &message) |
void | change_logging (const std::string &data) |
Change the log level of a log domain. More... | |
Friends | |
struct | lobby_delay_gamelist_update_guard |
Additional Inherited Members | |
Private Types inherited from events::chat_handler | |
enum | MESSAGE_TYPE { MESSAGE_PUBLIC, MESSAGE_PRIVATE } |
gui2::tlobby_main::tlobby_main | ( | const config & | game_config, |
lobby_info & | info, | ||
CVideo & | video, | ||
twesnothd_connection & | wesnothd_connection | ||
) |
gui2::tlobby_main::~tlobby_main | ( | ) |
Definition at line 393 of file lobby.cpp.
References lobby_update_timer_, and gui2::remove_timer().
|
private |
Definition at line 1218 of file lobby.cpp.
References active_window_, DBG_LB, gui2::tlistbox::get_row_grid(), preferences::grid(), gui2::twidget::tvisible::hidden, gui2::tlobby_chat_window::name, open_windows_, gui2::tlobby_chat_window::pending_messages, player_list_dirty_, roomlistbox_, and gui2::tlobby_chat_window::whisper.
Referenced by close_window(), pre_show(), and switch_to_window().
|
private |
Get the room* corresponding to the currently active window, or nullptr if a whisper window is active at the moment.
Definition at line 1040 of file lobby.cpp.
References active_window_, lobby_info::get_room(), lobby_info_, gui2::tlobby_chat_window::name, open_windows_, and gui2::tlobby_chat_window::whisper.
Referenced by process_room_join(), process_room_part(), process_room_query_response(), and update_playerlist().
|
private |
Add a message to the window for room "room".
Definition at line 1195 of file lobby.cpp.
References append_to_chatbox(), and font::escape_text().
Referenced by add_chat_room_message_received(), add_chat_room_message_sent(), add_whisper_received(), add_whisper_sent(), and process_room_query_response().
|
private |
Add a whisper message to the current window which is not the whisper window for "name".
Definition at line 1170 of file lobby.cpp.
References append_to_chatbox(), and font::escape_text().
Referenced by add_whisper_received(), and add_whisper_sent().
|
protectedvirtual |
inherited form chat_handler
Implements events::chat_handler.
Definition at line 184 of file lobby.cpp.
References append_to_chatbox(), and font::escape_text().
Referenced by send_chat_message().
|
protectedvirtual |
inherited form chat_handler
Reimplemented from events::chat_handler.
Definition at line 260 of file lobby.cpp.
References add_active_window_message(), add_room_window_message(), do_notify(), lobby_info::get_room(), increment_waiting_messages(), preferences::is_friend(), lobby_info_, LOG_LB, preferences::login(), NOTIFY_FRIEND_MESSAGE, NOTIFY_MESSAGE, NOTIFY_MESSAGE_OTHER_WINDOW, NOTIFY_NONE, NOTIFY_OWN_NICK, NOTIFY_SERVER_MESSAGE, room_window_active(), and utils::word_match().
Referenced by process_message(), process_room_join(), and process_room_query_response().
|
protectedvirtual |
inherited form chat_handler
Reimplemented from events::chat_handler.
Definition at line 241 of file lobby.cpp.
References add_active_window_message(), chat_log::add_message(), lobby_info::get_room(), lobby_info_, room_info::log(), LOG_LB, preferences::login(), room_window_active(), room_window_open(), and switch_to_window().
Referenced by send_message_to_active_window().
|
private |
Add a message to the window for room "room".
Definition at line 1180 of file lobby.cpp.
References append_to_chatbox(), ERR_LB, font::escape_text(), open_windows_, and room_window_open().
Referenced by add_chat_room_message_received(), process_room_join(), and process_room_part().
|
protectedvirtual |
inherited form chat_handler
Reimplemented from events::chat_handler.
Definition at line 216 of file lobby.cpp.
References add_active_window_message(), add_active_window_whisper(), chat_log::add_message(), add_whisper_window_whisper(), preferences::auto_open_whisper_windows(), do_notify(), lobby_info::get_whisper_log(), increment_waiting_whsipers(), preferences::is_friend(), lobby_info_, LOG_LB, NOTIFY_WHISPER, NOTIFY_WHISPER_OTHER_WINDOW, preferences::whisper_friends_only(), whisper_window_active(), and whisper_window_open().
Referenced by process_message().
|
protectedvirtual |
inherited form chat_handler
Reimplemented from events::chat_handler.
Definition at line 197 of file lobby.cpp.
References add_active_window_message(), add_active_window_whisper(), chat_log::add_message(), preferences::auto_open_whisper_windows(), lobby_info::get_whisper_log(), lobby_info_, preferences::login(), switch_to_window(), VGETTEXT, whisper_window_active(), and whisper_window_open().
Referenced by send_message_to_active_window().
|
private |
Add a whisper message to the whisper window.
Definition at line 1156 of file lobby.cpp.
References append_to_chatbox(), ERR_LB, open_windows_, and whisper_window_open().
Referenced by add_whisper_received().
|
protected |
Definition at line 699 of file lobby.cpp.
References game_info::can_join(), game_info::can_observe(), gui2::event::connect_signal_mouse_left_click(), game_info::fog, game_config_, preferences::grid(), game_info::have_era, join_button_callback(), join_or_observe(), game_info::map_data, observe_button_callback(), game_info::observers, game_info::password_required, game_info::reloaded, gui2::tbutton::set_active(), gui2::ttoggle_panel::set_callback_mouse_left_double_click(), gui2::tminimap::set_config(), gui2::tminimap::set_map_data(), game_info::shroud, game_info::shuffle_sides, game_info::started, game_info::time_limit, game_info::use_map_settings, and window_.
Referenced by update_gamelist(), and update_gamelist_diff().
|
private |
Append some text to the active chat log.
Definition at line 289 of file lobby.cpp.
References active_window_.
Referenced by add_active_window_message(), add_active_window_whisper(), add_chat_message(), add_room_window_message(), add_whisper_window_whisper(), and chat_input_keypress_callback().
|
private |
Append some text to the chat log for window "id".
Definition at line 294 of file lobby.cpp.
References chat_log_container_, gui2::tscrollbar_::END, preferences::get_chat_timestamp(), gui2::tscrollbar_container::get_vertical_scrollbar_item_position(), preferences::grid(), gui2::tcontrol::label(), gui2::tmulti_page::page_grid(), gui2::tscrollbar_container::scroll_vertical_scrollbar(), gui2::tscroll_label::set_label(), gui2::tscroll_label::set_use_markup(), gui2::tscrollbar_container::set_vertical_scrollbar_item_position(), and gui2::tscrollbar_container::vertical_scrollbar_at_end().
|
private |
Definition at line 1634 of file lobby.cpp.
References append_to_chatbox(), chat_input_, gui2::ttext_::get_value(), utils::join(), lobby_info_, preferences::login(), send_message_button_callback(), gui2::ttext_::set_value(), lobby_info::users(), and utils::word_completion().
Referenced by pre_show().
|
private |
Definition at line 1235 of file lobby.cpp.
References active_window_, close_window(), and DBG_LB.
|
private |
Definition at line 1241 of file lobby.cpp.
References active_window_, active_window_changed(), config::add_child(), chat_log_container_, chat_log::clear(), lobby_info::close_room(), DBG_LB, lobby_info::get_whisper_log(), lobby_info_, preferences::login(), game_logic::msg(), gui2::tlobby_chat_window::name, open_windows_, gui2::tmulti_page::remove_page(), gui2::tlistbox::remove_row(), roomlistbox_, gui2::tmulti_page::select_page(), gui2::tlistbox::select_row(), twesnothd_connection::send_data(), wesnothd_connection_, and gui2::tlobby_chat_window::whisper.
Referenced by close_active_window(), and close_window_button_callback().
|
private |
Definition at line 1596 of file lobby.cpp.
References close_window().
Referenced by search_create_window().
|
private |
Definition at line 1601 of file lobby.cpp.
References gui2::twindow::close(), CREATE, and legacy_result_.
Referenced by pre_show().
|
private |
Assemble and send a game join request.
Ask for password if the game requires one.
Definition at line 1525 of file lobby.cpp.
References config::add_child(), game_info::can_join(), game_info::can_observe(), ERR_LB, gui2::tmp_join_game_password_prompt::execute(), lobby_info::games(), game_info::id, utils::join(), lobby_info_, preferences::prv::password, game_info::password_required, twesnothd_connection::send_data(), game_info::started, video_, and wesnothd_connection_.
Referenced by join_global_button_callback(), join_or_observe(), and observe_global_button_callback().
|
inline |
Definition at line 142 of file lobby.hpp.
References do_notify().
Referenced by add_chat_room_message_received(), add_whisper_received(), do_notify(), and process_gamelist_diff().
void gui2::tlobby_main::do_notify | ( | t_notify_mode | mode, |
const std::string & | sender, | ||
const std::string & | message | ||
) |
Definition at line 311 of file lobby.cpp.
References mp_ui_alerts::friend_message(), NOTIFY_FRIEND_MESSAGE, NOTIFY_LOBBY_JOIN, NOTIFY_LOBBY_QUIT, NOTIFY_MESSAGE, NOTIFY_OWN_NICK, NOTIFY_SERVER_MESSAGE, NOTIFY_WHISPER, NOTIFY_WHISPER_OTHER_WINDOW, mp_ui_alerts::player_joins(), mp_ui_alerts::player_leaves(), mp_ui_alerts::private_message(), mp_ui_alerts::public_message(), and mp_ui_alerts::server_message().
|
private |
Definition at line 1706 of file lobby.cpp.
References game_filter_reload(), and update_gamelist_filter().
Referenced by pre_show().
Definition at line 1698 of file lobby.cpp.
References game_filter_reload(), and update_gamelist_filter().
Referenced by pre_show().
|
private |
Definition at line 1672 of file lobby.cpp.
References lobby_info::add_game_filter(), lobby_info::clear_game_filter(), filter_friends_, filter_ignored_, filter_invert_, filter_slots_, filter_text_, gui2::ttoggle_button::get_value(), gui2::ttext_::get_value(), gui2::tselectable_::get_value_bool(), lobby_info_, lobby_info::set_game_filter_invert(), utils::split(), and game_info::vacant_slots.
Referenced by game_filter_change_callback(), game_filter_keypress_callback(), and pre_show().
|
private |
Definition at line 1712 of file lobby.cpp.
References update_selected_game().
Referenced by pre_show().
|
inline |
Definition at line 123 of file lobby.hpp.
References legacy_result_.
Referenced by enter_lobby_mode().
|
private |
Mark the room window for "room" as having one more pending message.
Definition at line 1137 of file lobby.cpp.
References DBG_LB, gui2::tlistbox::get_row_grid(), preferences::grid(), open_windows_, room_window_open(), roomlistbox_, and gui2::twidget::tvisible::visible.
Referenced by add_chat_room_message_received().
|
private |
Mark the whisper window for "name" as having one more pending message.
Definition at line 1119 of file lobby.cpp.
References DBG_LB, gui2::tlistbox::get_row_grid(), preferences::grid(), open_windows_, roomlistbox_, gui2::twidget::tvisible::visible, and whisper_window_open().
Referenced by add_whisper_received().
|
private |
Definition at line 1486 of file lobby.cpp.
References join_global_button_callback(), and LOG_LB.
Referenced by adjust_game_row_contents().
|
private |
Definition at line 1507 of file lobby.cpp.
References gui2::twindow::close(), do_game_join(), gamelistbox_, gui2::tlistbox::get_selected_row(), JOIN, legacy_result_, and LOG_LB.
Referenced by join_button_callback(), and pre_show().
Definition at line 1516 of file lobby.cpp.
References game_info::can_join(), gui2::twindow::close(), do_game_join(), lobby_info::games(), JOIN, legacy_result_, lobby_info_, OBSERVE, and window_.
Referenced by adjust_game_row_contents().
|
protected |
Definition at line 636 of file lobby.cpp.
References _(), game_info::era, game_info::era_short, game_info::fog, game_info::gold, game_info::have_era, game_info::map_info, game_info::map_size_info, game_info::name, game_info::observers, game_info::reloaded, game_info::scenario, game_info::shroud, game_info::started, game_info::status, game_info::time_limit, game_info::vacant_slots, game_info::vision, and game_info::xp.
Referenced by update_gamelist(), and update_gamelist_diff().
|
private |
Network polling callback.
Definition at line 1275 of file lobby.cpp.
References delay_gamelist_update_, e, gamelist_diff_update_, gamelist_dirty_, last_gamelist_update_, game_config::lobby_refresh, LOG_LB, game::error::message, player_list_dirty_, process_network_data(), twesnothd_connection::receive_data(), update_gamelist(), update_gamelist_diff(), update_gamelist_filter(), update_playerlist(), and wesnothd_connection_.
Referenced by pre_show().
|
private |
Definition at line 1492 of file lobby.cpp.
References LOG_LB, and observe_global_button_callback().
Referenced by adjust_game_row_contents().
|
private |
Definition at line 1498 of file lobby.cpp.
References gui2::twindow::close(), do_game_join(), gamelistbox_, gui2::tlistbox::get_selected_row(), legacy_result_, LOG_LB, and OBSERVE.
Referenced by observe_button_callback(), and pre_show().
|
private |
Definition at line 1717 of file lobby.cpp.
References gui2::tselectable_::get_value_bool(), player_list_, player_list_dirty_, preferences::set_playerlist_sort_name(), preferences::set_playerlist_sort_relation(), gui2::tplayer_list::sort_by_name, gui2::tplayer_list::sort_by_relation, and gui2::tplayer_list::update_sort_icons().
Referenced by pre_show().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 408 of file lobby.cpp.
References gui2::fullscreen(), gui2::function_wrapper(), hotkey::HOTKEY_FULLSCREEN, hotkey::HOTKEY_PREFERENCES, preferences_wrapper_, gui2::event::tdispatcher::register_hotkey(), show_preferences_button_callback(), and gui2::twindow::video().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 1033 of file lobby.cpp.
References lobby_update_timer_, gui2::remove_timer(), and window_.
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 903 of file lobby.cpp.
References active_window_changed(), gui2::add_timer(), chat_input_, chat_input_keypress_callback(), chat_log_container_, gui2::event::connect_signal_mouse_left_click(), gui2::event::connect_signal_notify_modified(), gui2::event::connect_signal_pre_key_press(), create_button_callback(), gui2::dialog_callback(), filter_friends_, filter_ignored_, filter_invert_, filter_slots_, filter_text_, game_filter_change_callback(), game_filter_keypress_callback(), game_filter_reload(), gamelist_change_callback(), gamelistbox_, gui2::tplayer_list::init(), join_global_button_callback(), game_config::lobby_network_timer, lobby_update_timer_, network_handler(), observe_global_button_callback(), player_filter_callback(), player_list_, preferences::playerlist_sort_name(), preferences::playerlist_sort_relation(), refresh_button_callback(), room_switch_callback(), room_window_open(), roomlistbox_, SCOPE_LB, gui2::ttoggle_button::set_callback_state_change(), gui2::tlistbox::set_callback_value_change(), gui2::ttoggle_button::set_value(), show_preferences_button_callback(), preferences::skip_mp_replay(), skip_replay_changed_callback(), gui2::tplayer_list::sort_by_name, gui2::tplayer_list::sort_by_relation, gui2::tplayer_list::update_sort_icons(), and window_.
Definition at line 1349 of file lobby.cpp.
References DBG_LB, gamelist_diff_update_, gamelist_dirty_, lobby_info_, and lobby_info::process_gamelist().
Referenced by process_network_data().
Definition at line 1357 of file lobby.cpp.
References config::child_count(), DBG_LB, do_notify(), ERR_LB, gamelist_dirty_, lobby_info_, NOTIFY_LOBBY_JOIN, NOTIFY_LOBBY_QUIT, and lobby_info::process_gamelist_diff().
Referenced by process_network_data().
Definition at line 1327 of file lobby.cpp.
References add_chat_room_message_received(), add_whisper_received(), DBG_LB, preferences::is_ignored(), LOG_LB, and preferences::parse_admin_authentication().
Referenced by process_network_data().
Definition at line 1306 of file lobby.cpp.
References config::child(), process_gamelist(), process_gamelist_diff(), process_message(), process_room_join(), process_room_part(), and process_room_query_response().
Referenced by network_handler().
Definition at line 1376 of file lobby.cpp.
References active_window_room(), add_chat_room_message_received(), room_info::add_member(), add_room_window_message(), config::child(), DBG_LB, lobby_info::get_room(), lobby_info_, LOG_LB, preferences::login(), lobby_info::open_room(), player_list_dirty_, room_info::process_room_members(), room_window_open(), switch_to_window(), and VGETTEXT.
Referenced by process_network_data().
Definition at line 1424 of file lobby.cpp.
References active_window_room(), add_room_window_message(), DBG_LB, lobby_info::get_room(), lobby_info_, LOG_LB, player_list_dirty_, room_info::remove_member(), and VGETTEXT.
Referenced by process_network_data().
Definition at line 1446 of file lobby.cpp.
References active_window_room(), add_active_window_message(), add_chat_room_message_received(), config::child(), DBG_LB, lobby_info::get_room(), lobby_info_, player_list_dirty_, room_info::process_room_members(), and room_window_open().
Referenced by process_network_data().
|
private |
Definition at line 1607 of file lobby.cpp.
References twesnothd_connection::send_data(), and wesnothd_connection_.
Referenced by pre_show().
Definition at line 1629 of file lobby.cpp.
References gui2::tlistbox::get_selected_row(), roomlistbox_, and switch_to_window().
Referenced by pre_show().
|
private |
Definition at line 1113 of file lobby.cpp.
References active_window_, gui2::tlobby_chat_window::name, open_windows_, and gui2::tlobby_chat_window::whisper.
Referenced by add_chat_room_message_received(), and add_chat_room_message_sent().
|
private |
Check if a room window for "room" is open, if open_new is true then it will be created if not found.
Definition at line 1048 of file lobby.cpp.
References search_create_window().
Referenced by add_chat_room_message_sent(), add_room_window_message(), increment_waiting_messages(), pre_show(), process_room_join(), and process_room_query_response().
|
private |
Helper function to find and open a new window, used by *_window_open.
Definition at line 1060 of file lobby.cpp.
References gui2::tmulti_page::add_page(), gui2::tlistbox::add_row(), chat_log_container_, close_window_button_callback(), gui2::event::connect_signal_mouse_left_click(), gui2::tlistbox::get_item_count(), gui2::tlistbox::get_row_grid(), gui2::twidget::tvisible::hidden, lobby_info_, lobby_info::open_room(), open_windows_, roomlistbox_, gui2::twidget::set_visible(), and VGETTEXT.
Referenced by room_window_open(), and whisper_window_open().
|
protectedvirtual |
inherited form chat_handler
Implements events::chat_handler.
Definition at line 166 of file lobby.cpp.
References add_chat_message(), config::add_child(), preferences::login(), game_logic::msg(), twesnothd_connection::send_data(), and wesnothd_connection_.
|
private |
Definition at line 1566 of file lobby.cpp.
References chat_input_, gui2::ttext_::get_value(), game_logic::msg(), gui2::ttext_box::save_to_history(), send_message_to_active_window(), and gui2::ttext_::set_value().
Referenced by chat_input_keypress_callback().
|
private |
Definition at line 1584 of file lobby.cpp.
References active_window_, add_chat_room_message_sent(), add_whisper_sent(), gui2::tlobby_chat_window::name, open_windows_, events::chat_handler::send_chat_room_message(), events::chat_handler::send_whisper(), and gui2::tlobby_chat_window::whisper.
Referenced by send_message_button_callback().
Implements events::chat_handler.
Definition at line 1768 of file lobby.cpp.
References twesnothd_connection::send_data(), and wesnothd_connection_.
Set the callback used to show the preferences.
Definition at line 388 of file lobby.cpp.
References preferences_callback_.
Referenced by enter_lobby_mode().
|
private |
The screen size might have changed force an update of the size.
Definition at line 1613 of file lobby.cpp.
References gui2::twindow::invalidate_layout(), preferences_callback_, twesnothd_connection::send_data(), and wesnothd_connection_.
Referenced by post_build(), and pre_show().
Definition at line 1763 of file lobby.cpp.
References gui2::tselectable_::get_value_bool(), and preferences::set_skip_mp_replay().
Referenced by pre_show().
|
private |
Switch to the window given by a valid pointer (e.g.
received from a call to *_window_open)
Definition at line 1204 of file lobby.cpp.
References open_windows_.
Referenced by add_chat_room_message_sent(), add_whisper_sent(), process_room_join(), room_switch_callback(), and user_dialog_callback().
|
private |
Definition at line 1209 of file lobby.cpp.
References active_window_, active_window_changed(), chat_log_container_, gui2::id, open_windows_, roomlistbox_, gui2::tmulti_page::select_page(), and gui2::tlistbox::select_row().
void gui2::tlobby_main::update_gamelist | ( | ) |
Definition at line 494 of file lobby.cpp.
References gui2::tlistbox::add_row(), adjust_game_row_contents(), lobby_info::apply_game_filter(), gui2::tlistbox::clear(), gamelist_dirty_, gamelist_id_at_row_, gamelistbox_, lobby_info::games(), lobby_info::games_visibility(), gui2::tlistbox::get_item_count(), gui2::tlistbox::get_row_grid(), gui2::tlistbox::get_selected_row(), preferences::grid(), i, game_info::id, last_gamelist_update_, lobby_info_, LOG_LB, make_game_row_data(), lobby_info::make_games_vector(), SCOPE_LB, gui2::tlistbox::select_row(), selected_game_id_, gui2::tlistbox::set_row_shown(), lobby_info::sync_games_display_status(), update_gamelist_header(), and update_selected_game().
Referenced by network_handler().
|
protected |
Definition at line 526 of file lobby.cpp.
References gui2::tlistbox::add_row(), adjust_game_row_contents(), lobby_info::apply_game_filter(), DBG_LB, game_info::DELETED, game_info::display_status, ERR_LB, gamelist_dirty_, gamelist_id_at_row_, gamelistbox_, lobby_info::games(), lobby_info::games_visibility(), gui2::tlistbox::get_item_count(), gui2::tlistbox::get_row_grid(), gui2::tlistbox::get_selected_row(), preferences::grid(), i, game_info::id, last_gamelist_update_, lobby_info_, LOG_LB, make_game_row_data(), lobby_info::make_games_vector(), game_info::NEW, gui2::tlistbox::remove_row(), SCOPE_LB, gui2::tlistbox::select_row(), selected_game_id_, twesnothd_connection::send_data(), gui2::tlistbox::set_row_shown(), lobby_info::sync_games_display_status(), update_gamelist_header(), update_selected_game(), game_info::UPDATED, and wesnothd_connection_.
Referenced by network_handler().
|
protected |
Definition at line 752 of file lobby.cpp.
References lobby_info::apply_game_filter(), DBG_LB, gamelistbox_, lobby_info::games(), lobby_info::games_visibility(), gui2::tlistbox::get_item_count(), lobby_info_, and gui2::tlistbox::set_row_shown().
Referenced by game_filter_change_callback(), game_filter_keypress_callback(), and network_handler().
|
protected |
Definition at line 621 of file lobby.cpp.
References gamelistbox_, lobby_info::games(), lobby_info::games_filtered(), lobby_info_, gui2::set_label(), and VGETTEXT.
Referenced by update_gamelist(), and update_gamelist_diff().
void gui2::tlobby_main::update_playerlist | ( | ) |
Definition at line 763 of file lobby.cpp.
References gui2::tplayer_list::active_game, gui2::tplayer_list::active_room, active_window_room(), gui2::ttree_view_node::add_child(), gui2::tsub_player_list::auto_hide(), gui2::tlistbox::clear(), gui2::ttree_view_node::clear(), DBG_LB, delay_playerlist_update_, ERR_LB, user_info::FRIEND, user_info::GAME, gui2::tselectable_::get_value_bool(), user_info::IGNORED, gui2::tsub_player_list::list, user_info::LOBBY, lobby_info_, user_info::ME, user_info::name, user_info::NEUTRAL, user_info::observing, gui2::tplayer_list::other_games, gui2::tplayer_list::other_rooms, player_list_, player_list_dirty_, preferences::playerlist_group_players(), user_info::registered, user_info::relation, SCOPE_LB, user_info::SEL_GAME, user_info::SEL_ROOM, selected_game_id_, gui2::tplayer_list::sort_by_name, gui2::tplayer_list::sort_by_relation, lobby_info::sort_users(), user_info::state, gui2::tsub_player_list::tree, lobby_info::update_user_statuses(), user_dialog_callback(), lobby_info::users(), and lobby_info::users_sorted().
Referenced by network_handler().
|
private |
Definition at line 883 of file lobby.cpp.
References game_info::can_join(), game_info::can_observe(), gamelistbox_, lobby_info::games(), gui2::tlistbox::get_selected_row(), game_info::id, lobby_info_, player_list_dirty_, selected_game_id_, and window_.
Referenced by gamelist_change_callback(), update_gamelist(), and update_gamelist_diff().
Definition at line 1728 of file lobby.cpp.
References delay_playerlist_update_, g, user_info::game_id, gui2::twindow::invalidate_layout(), lobby_info_, user_info::name, player_list_dirty_, gui2::tlobby_player_info::result_open_whisper(), selected_game_id_, twesnothd_connection::send_data(), gui2::tdialog::show(), switch_to_window(), gui2::twindow::video(), wesnothd_connection_, whisper_window_open(), and window_.
Referenced by update_playerlist().
|
protectedvirtual |
Called when a processed command results in a relation (friend/ignore) change for a user whose name is passed as the 'name' arg.
Reimplemented from events::chat_handler.
Definition at line 179 of file lobby.cpp.
References player_list_dirty_.
|
private |
Definition at line 1107 of file lobby.cpp.
References active_window_, gui2::tlobby_chat_window::name, open_windows_, and gui2::tlobby_chat_window::whisper.
Referenced by add_whisper_received(), and add_whisper_sent().
|
private |
Check if a whisper window for user "name" is open, if open_new is true then it will be created if not found.
Definition at line 1054 of file lobby.cpp.
References search_create_window().
Referenced by add_whisper_received(), add_whisper_sent(), add_whisper_window_whisper(), increment_waiting_whsipers(), and user_dialog_callback().
|
privatevirtual |
Inherited from tdialog, implemented by REGISTER_DIALOG.
Implements gui2::tdialog.
|
friend |
|
private |
Definition at line 395 of file lobby.hpp.
Referenced by active_window_changed(), active_window_room(), append_to_chatbox(), close_active_window(), close_window(), room_window_active(), send_message_to_active_window(), switch_to_window(), and whisper_window_active().
|
private |
Definition at line 381 of file lobby.hpp.
Referenced by chat_input_keypress_callback(), pre_show(), and send_message_button_callback().
|
private |
Definition at line 379 of file lobby.hpp.
Referenced by append_to_chatbox(), close_window(), pre_show(), search_create_window(), and switch_to_window().
|
private |
Definition at line 433 of file lobby.hpp.
Referenced by gui2::lobby_delay_gamelist_update_guard::lobby_delay_gamelist_update_guard(), and network_handler().
|
private |
Definition at line 431 of file lobby.hpp.
Referenced by update_playerlist(), and user_dialog_callback().
|
private |
Definition at line 397 of file lobby.hpp.
Referenced by game_filter_reload(), and pre_show().
|
private |
Definition at line 399 of file lobby.hpp.
Referenced by game_filter_reload(), and pre_show().
|
private |
Definition at line 403 of file lobby.hpp.
Referenced by game_filter_reload(), and pre_show().
|
private |
Definition at line 401 of file lobby.hpp.
Referenced by game_filter_reload(), and pre_show().
|
private |
Definition at line 405 of file lobby.hpp.
Referenced by game_filter_reload(), and pre_show().
|
private |
Definition at line 371 of file lobby.hpp.
Referenced by adjust_game_row_contents().
|
private |
Definition at line 417 of file lobby.hpp.
Referenced by network_handler(), and process_gamelist().
|
private |
Definition at line 413 of file lobby.hpp.
Referenced by network_handler(), process_gamelist(), process_gamelist_diff(), update_gamelist(), and update_gamelist_diff().
|
private |
Definition at line 429 of file lobby.hpp.
Referenced by update_gamelist(), and update_gamelist_diff().
|
private |
Definition at line 373 of file lobby.hpp.
Referenced by join_global_button_callback(), observe_global_button_callback(), pre_show(), update_gamelist(), update_gamelist_diff(), update_gamelist_filter(), update_gamelist_header(), and update_selected_game().
|
private |
Definition at line 415 of file lobby.hpp.
Referenced by network_handler(), update_gamelist(), and update_gamelist_diff().
|
private |
Result flag for interfacing with other MP dialogs.
Definition at line 193 of file lobby.hpp.
Referenced by create_button_callback(), get_legacy_result(), join_global_button_callback(), join_or_observe(), and observe_global_button_callback().
|
private |
Definition at line 385 of file lobby.hpp.
Referenced by active_window_room(), add_chat_room_message_received(), add_chat_room_message_sent(), add_whisper_received(), add_whisper_sent(), chat_input_keypress_callback(), close_window(), do_game_join(), game_filter_reload(), join_or_observe(), process_gamelist(), process_gamelist_diff(), process_room_join(), process_room_part(), process_room_query_response(), search_create_window(), update_gamelist(), update_gamelist_diff(), update_gamelist_filter(), update_gamelist_header(), update_playerlist(), update_selected_game(), and user_dialog_callback().
|
private |
Timer for updating the lobby.
Definition at line 424 of file lobby.hpp.
Referenced by post_show(), pre_show(), and ~tlobby_main().
|
private |
This represents the open chat windows (rooms and whispers at the moment) with 1 to 1 correspondence to what the user sees in the interface.
Definition at line 393 of file lobby.hpp.
Referenced by active_window_changed(), active_window_room(), add_room_window_message(), add_whisper_window_whisper(), close_window(), increment_waiting_messages(), increment_waiting_whsipers(), room_window_active(), search_create_window(), send_message_to_active_window(), switch_to_window(), and whisper_window_active().
|
private |
Definition at line 409 of file lobby.hpp.
Referenced by player_filter_callback(), pre_show(), and update_playerlist().
|
private |
Definition at line 411 of file lobby.hpp.
Referenced by active_window_changed(), network_handler(), player_filter_callback(), process_room_join(), process_room_part(), process_room_query_response(), update_playerlist(), update_selected_game(), user_dialog_callback(), and user_relation_changed().
|
private |
Definition at line 387 of file lobby.hpp.
Referenced by set_preferences_callback(), and show_preferences_button_callback().
|
private |
Wrapper for the preferences hotkey.
Definition at line 427 of file lobby.hpp.
Referenced by post_build().
|
private |
Definition at line 377 of file lobby.hpp.
Referenced by active_window_changed(), close_window(), increment_waiting_messages(), increment_waiting_whsipers(), pre_show(), room_switch_callback(), search_create_window(), and switch_to_window().
|
private |
Definition at line 407 of file lobby.hpp.
Referenced by update_gamelist(), update_gamelist_diff(), update_playerlist(), update_selected_game(), and user_dialog_callback().
|
private |
Definition at line 419 of file lobby.hpp.
Referenced by do_game_join().
|
private |
Definition at line 421 of file lobby.hpp.
Referenced by close_window(), do_game_join(), network_handler(), refresh_button_callback(), send_chat_message(), send_to_server(), show_preferences_button_callback(), update_gamelist_diff(), and user_dialog_callback().
|
private |
Definition at line 383 of file lobby.hpp.
Referenced by adjust_game_row_contents(), join_or_observe(), post_show(), pre_show(), update_selected_game(), and user_dialog_callback().