#include <lobby_player_list_helper.hpp>
Classes | |
| struct | sub_list |
Public Member Functions | |
| void | init (window &w) |
| void | update (const std::vector< mp::user_info > &user_info, int focused_game) |
| Updates the tree contents based on the given user data. More... | |
| lobby_player_list_helper (decltype(user_callback) ucb, decltype(game_select_callback) gscb) | |
| const mp::user_info * | get_selected_info () const |
Private Member Functions | |
| void | selected_node_changed () |
| Connected to the tree's modified signal; forwards to game_select_callback when a player is selected. More... | |
Private Attributes | |
| std::array< sub_list, 3 > | player_lists |
| Main subsections of the player tree. More... | |
| tree_view * | tree |
| The parent tree. More... | |
| std::function< void(const mp::user_info *)> | user_callback |
| The double click callback bound to each player's tree node. More... | |
| std::function< void(const mp::user_info *)> | game_select_callback |
| Called with the newly-selected player when the tree's selection changes to one. More... | |
| std::map< const tree_view_node *, const mp::user_info * > | info_map |
| Node-to-info mappings for easy access. More... | |
Definition at line 35 of file lobby_player_list_helper.hpp.
|
inline |
Definition at line 75 of file lobby_player_list_helper.hpp.
| const mp::user_info * gui2::lobby_player_list_helper::get_selected_info | ( | ) | const |
Definition at line 181 of file lobby_player_list_helper.cpp.
References info_map, gui2::tree_view::selected_item(), and tree.
Referenced by gui2::dialogs::mp_lobby::open_match_history(), and gui2::dialogs::mp_lobby::open_profile_url().
| void gui2::lobby_player_list_helper::init | ( | window & | w | ) |
Definition at line 166 of file lobby_player_list_helper.cpp.
References _(), gui2::event::connect_signal_notify_modified(), player_lists, selected_node_changed(), tree, and w.
Referenced by gui2::dialogs::mp_lobby::pre_show().
|
private |
Connected to the tree's modified signal; forwards to game_select_callback when a player is selected.
Definition at line 186 of file lobby_player_list_helper.cpp.
References game_select_callback, info_map, gui2::tree_view::selected_item(), and tree.
Referenced by init().
| void gui2::lobby_player_list_helper::update | ( | const std::vector< mp::user_info > & | user_info, |
| int | focused_game | ||
| ) |
Updates the tree contents based on the given user data.
Definition at line 63 of file lobby_player_list_helper.cpp.
References gui2::event::connect_signal_mouse_left_double_click(), mp::user_info::FRIEND, mp::user_info::GAME, gui2::widget::get_origin(), gui2::scrollbar_container::get_vertical_scrollbar_item_position(), font::GRAY_COLOR, i, mp::user_info::IGNORED, lg::info(), info_map, mp::user_info::LOBBY, mp::user_info::ME, mp::user_info::NEUTRAL, node_data, player_lists, mp::user_info::SEL_GAME, gui2::scrollbar_container::set_vertical_scrollbar_item_position(), markup::span_color(), tree, user_callback, and value.
Referenced by gui2::dialogs::mp_lobby::update_playerlist().
|
private |
Called with the newly-selected player when the tree's selection changes to one.
Definition at line 66 of file lobby_player_list_helper.hpp.
Referenced by selected_node_changed().
|
private |
Node-to-info mappings for easy access.
Definition at line 69 of file lobby_player_list_helper.hpp.
Referenced by get_selected_info(), selected_node_changed(), and update().
|
private |
Main subsections of the player tree.
This should never change at runtime so the number is hardcoded.
Definition at line 57 of file lobby_player_list_helper.hpp.
|
private |
The parent tree.
Definition at line 60 of file lobby_player_list_helper.hpp.
Referenced by get_selected_info(), init(), selected_node_changed(), and update().
|
private |
The double click callback bound to each player's tree node.
Definition at line 63 of file lobby_player_list_helper.hpp.
Referenced by update().