#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) | |
const mp::user_info * | get_selected_info () const |
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::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 69 of file lobby_player_list_helper.hpp.
const mp::user_info * gui2::lobby_player_list_helper::get_selected_info | ( | ) | const |
Definition at line 177 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 _(), player_lists, tree, and w.
Referenced by gui2::dialogs::mp_lobby::pre_show().
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, and user_callback.
Referenced by gui2::dialogs::mp_lobby::update_playerlist().
|
private |
Node-to-info mappings for easy access.
Definition at line 66 of file lobby_player_list_helper.hpp.
Referenced by get_selected_info(), 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(), 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().