RigsofRods
Soft-body Physics Simulation
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 
35 namespace RoR {
36 namespace GUI {
37 
39 {
40 public:
41  void Draw();
42  void UpdateClients();
43 
44 private:
45  bool DrawIcon(Ogre::TexturePtr tex, ImVec2 reference_box); // Returns true if hovered
46  void CacheIcons();
47 
48  std::vector<RoRnet::UserInfo> m_users; // only updated on demand to reduce mutex locking and vector allocating overhead.
49 
50  // Icon cache
51  bool m_icons_cached = false;
52  Ogre::TexturePtr m_icon_arrow_down;
53  Ogre::TexturePtr m_icon_arrow_down_grey;
54  Ogre::TexturePtr m_icon_arrow_down_red;
55  Ogre::TexturePtr m_icon_arrow_up;
56  Ogre::TexturePtr m_icon_arrow_up_grey;
57  Ogre::TexturePtr m_icon_arrow_up_red;
58  Ogre::TexturePtr m_icon_flag_red;
59  Ogre::TexturePtr m_icon_flag_blue;
60  Ogre::TexturePtr m_icon_flag_green;
61  Ogre::TexturePtr m_icon_warn_triangle;
62 };
63 
64 } // namespace GUI
65 } // namespace RoR
RoR::GUI::MpClientList::m_icon_flag_red
Ogre::TexturePtr m_icon_flag_red
Definition: GUI_MultiplayerClientList.h:58
RoR::GUI::MpClientList::m_icons_cached
bool m_icons_cached
Definition: GUI_MultiplayerClientList.h:51
RoR::GUI::MpClientList::m_icon_arrow_down_red
Ogre::TexturePtr m_icon_arrow_down_red
Definition: GUI_MultiplayerClientList.h:54
RoR::GUI::MpClientList::m_icon_arrow_up
Ogre::TexturePtr m_icon_arrow_up
Definition: GUI_MultiplayerClientList.h:55
RoR::GUI::MpClientList::CacheIcons
void CacheIcons()
Definition: GUI_MultiplayerClientList.cpp:254
RoR::GUI::MpClientList::m_icon_arrow_up_red
Ogre::TexturePtr m_icon_arrow_up_red
Definition: GUI_MultiplayerClientList.h:57
RoR::GUI::MpClientList::m_icon_arrow_up_grey
Ogre::TexturePtr m_icon_arrow_up_grey
Definition: GUI_MultiplayerClientList.h:56
RoR::GUI::MpClientList::m_icon_arrow_down_grey
Ogre::TexturePtr m_icon_arrow_down_grey
Definition: GUI_MultiplayerClientList.h:53
RoR::GUI::MpClientList::m_users
std::vector< RoRnet::UserInfo > m_users
Definition: GUI_MultiplayerClientList.h:48
RoR::GUI::MpClientList::m_icon_flag_green
Ogre::TexturePtr m_icon_flag_green
Definition: GUI_MultiplayerClientList.h:60
RoR::GUI::MpClientList
Definition: GUI_MultiplayerClientList.h:38
RoR::GUI::MpClientList::m_icon_flag_blue
Ogre::TexturePtr m_icon_flag_blue
Definition: GUI_MultiplayerClientList.h:59
RoR::GUI::MpClientList::DrawIcon
bool DrawIcon(Ogre::TexturePtr tex, ImVec2 reference_box)
Definition: GUI_MultiplayerClientList.cpp:237
RoR::GUI::MpClientList::UpdateClients
void UpdateClients()
Definition: GUI_MultiplayerClientList.cpp:45
RoR::GUI::MpClientList::m_icon_warn_triangle
Ogre::TexturePtr m_icon_warn_triangle
Definition: GUI_MultiplayerClientList.h:61
RoR::GUI::MpClientList::m_icon_arrow_down
Ogre::TexturePtr m_icon_arrow_down
Definition: GUI_MultiplayerClientList.h:52
RoR
Definition: AppContext.h:36
RoR::GUI::MpClientList::Draw
void Draw()
Definition: GUI_MultiplayerClientList.cpp:53