Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
GUI_MultiplayerClientList.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2019 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
25
27
28#pragma once
29
30#include "RoRnet.h"
31
32#include <Ogre.h>
33#include <imgui.h>
34
35namespace RoR {
36namespace GUI {
37
39{
40public:
41 void Draw();
42 void UpdateClients();
43
44private:
45 void DrawIcon(Ogre::TexturePtr tex, ImVec2 reference_box);
46 void CacheIcons();
47
48 std::vector<RoRnet::UserInfo> m_users; // only updated on demand to reduce mutex locking and vector allocating overhead; see `MSG_GUI_MP_CLIENTS_REFRESH`.
49 std::vector <BitMask_t> m_users_peeropts; // updated along with `m_users`, see `MSG_GUI_MP_CLIENTS_REFRESH`.
50
51 // Peer options menu - opened by [<] button, closes when mouse cursor leaves.
53 void DrawPeerOptCheckbox(const BitMask_t flag, const std::string& label);
54 void DrawServerCommandBtn(const std::string& cmdfmt, const std::string& label);
56 const int PEEROPTS_MENU_MARGIN = 10;
57 const int PEEROPTS_HOVER_MARGIN = 100;
59 ImVec2 m_peeropts_menu_corner_tl = ImVec2(0, 0);
60 ImVec2 m_peeropts_menu_corner_br = ImVec2(0, 0);
61
62 // Icon cache
63 bool m_icons_cached = false;
64 Ogre::TexturePtr m_icon_arrow_down;
65 Ogre::TexturePtr m_icon_arrow_down_grey;
66 Ogre::TexturePtr m_icon_arrow_down_red;
67 Ogre::TexturePtr m_icon_arrow_up;
68 Ogre::TexturePtr m_icon_arrow_up_grey;
69 Ogre::TexturePtr m_icon_arrow_up_red;
70 Ogre::TexturePtr m_icon_flag_red;
71 Ogre::TexturePtr m_icon_flag_blue;
72 Ogre::TexturePtr m_icon_flag_green;
73 Ogre::TexturePtr m_icon_warn_triangle;
74};
75
76} // namespace GUI
77} // namespace RoR
uint32_t BitMask_t
Definition BitFlags.h:7
void DrawServerCommandBtn(const std::string &cmdfmt, const std::string &label)
std::vector< BitMask_t > m_users_peeropts
void DrawPeerOptCheckbox(const BitMask_t flag, const std::string &label)
void DrawIcon(Ogre::TexturePtr tex, ImVec2 reference_box)
std::vector< RoRnet::UserInfo > m_users