RigsofRods
Soft-body Physics Simulation
GUI_VehicleInfoTPanel.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-2024 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 
26 
27 #pragma once
28 
29 #include "ForwardDeclarations.h"
30 
31 namespace RoR {
32 namespace GUI {
33 
35 {
36 public:
39 
41  bool IsVisible(TPanelFocus focus = TPANELFOCUS_NONE) const { return m_visibility_mode == TPANELMODE_OPAQUE && (focus == TPANELFOCUS_NONE || focus == m_current_focus); }
43  bool IsHornButtonActive() const { return m_horn_btn_active; }
44 
45  void UpdateStats(float dt, ActorPtr actor);
46  void Draw(RoR::GfxActor* actorx);
47 
48 private:
54  Ogre::Timer m_startupdemo_timer;
55  bool m_startupdemo_init = false;
56  ImVec4 m_panel_translucent_color = ImVec4(0.1f, 0.1f, 0.1f, 0.5f);
57  ImVec4 m_transluc_textdis_color = ImVec4(0.64f, 0.64f, 0.63f, 1.f);
59 
64 
67 
68  ImVec4 m_cmdbeam_highlight_color = ImVec4(0.733f, 1.f, 0.157f, 0.745f);
71  ImVec4 m_command_hovered_text_color = ImVec4(0.1f, 0.1f, 0.1f, 1.f);
72  bool m_helptext_fullsize = false;
74 
77  void DrawVehicleStatsUI(RoR::GfxActor* actorx);
78  float m_stat_health = 0.f;
81  float m_stat_beam_stress = 0.f;
82  float m_stat_mass_Kg = 0.f;
83  float m_stat_avg_deform = 0.f;
84  float m_stat_gcur_x = 0.f;
85  float m_stat_gcur_y = 0.f;
86  float m_stat_gcur_z = 0.f;
87  float m_stat_gmax_x = 0.f;
88  float m_stat_gmax_y = 0.f;
89  float m_stat_gmax_z = 0.f;
91 
94  void DrawVehicleDiagUI(RoR::GfxActor* actorx);
96 
99  void DrawVehicleBasicsUI(RoR::GfxActor* actorx);
100  void DrawHeadLightButton(RoR::GfxActor* actorx);
101  void DrawLeftBlinkerButton(RoR::GfxActor* actorx);
103  void DrawWarnBlinkerButton(RoR::GfxActor* actorx);
104  void DrawHornButton(RoR::GfxActor* actorx);
105  void DrawMirrorButton(RoR::GfxActor* actorx);
106  void DrawRepairButton(RoR::GfxActor* actorx);
111  void DrawAxleDiffButton(RoR::GfxActor* actorx);
112  void DrawWheelDiffButton(RoR::GfxActor* actorx);
115  void DrawParticlesButton(RoR::GfxActor* actorx);
116  void DrawBeaconButton(RoR::GfxActor* actorx);
117  void DrawShiftModeButton(RoR::GfxActor* actorx);
118  void DrawEngineButton(RoR::GfxActor* actorx);
119  void DrawCustomLightButton(RoR::GfxActor* actorx);
120  void DrawLockButton(RoR::GfxActor* actorx);
121  void DrawSecureButton(RoR::GfxActor* actorx);
123  void DrawCameraButton();
124  void CacheIcons();
125  bool m_horn_btn_active = false;
126  bool m_icons_cached = false;
127  Ogre::TexturePtr m_headlight_icon;
128  Ogre::TexturePtr m_left_blinker_icon;
129  Ogre::TexturePtr m_right_blinker_icon;
130  Ogre::TexturePtr m_warning_light_icon;
131  Ogre::TexturePtr m_horn_icon;
132  Ogre::TexturePtr m_mirror_icon;
133  Ogre::TexturePtr m_repair_icon;
134  Ogre::TexturePtr m_parking_brake_icon;
135  Ogre::TexturePtr m_traction_control_icon;
136  Ogre::TexturePtr m_abs_icon;
137  Ogre::TexturePtr m_physics_icon;
138  Ogre::TexturePtr m_actor_physics_icon;
139  Ogre::TexturePtr m_a_icon;
140  Ogre::TexturePtr m_w_icon;
141  Ogre::TexturePtr m_m_icon;
142  Ogre::TexturePtr m_g_icon;
143  Ogre::TexturePtr m_particle_icon;
144  Ogre::TexturePtr m_shift_icon;
145  Ogre::TexturePtr m_engine_icon;
146  Ogre::TexturePtr m_beacons_icon;
147  Ogre::TexturePtr m_camera_icon;
148  Ogre::TexturePtr m_lock_icon;
149  Ogre::TexturePtr m_secure_icon;
150  Ogre::TexturePtr m_cruise_control_icon;
152 };
153 
154 
155 
156 } // namespace GUI
157 } // namespace RoR
RoR::GUI::VehicleInfoTPanel::m_m_icon
Ogre::TexturePtr m_m_icon
Definition: GUI_VehicleInfoTPanel.h:141
RoR::GUI::VehicleInfoTPanel::IsVisible
bool IsVisible(TPanelFocus focus=TPANELFOCUS_NONE) const
Definition: GUI_VehicleInfoTPanel.h:41
RoR::GUI::VehicleInfoTPanel::DrawEngineButton
void DrawEngineButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1010
RoR::GUI::VehicleInfoTPanel::m_stat_deformed_beams
int m_stat_deformed_beams
Definition: GUI_VehicleInfoTPanel.h:80
RoR::GUI::VehicleInfoTPanel::DrawRepairButton
void DrawRepairButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:888
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_NONE
@ TPANELFOCUS_NONE
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::TPanelFocus
TPanelFocus
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::m_stat_health
float m_stat_health
Definition: GUI_VehicleInfoTPanel.h:78
RoR::GUI::VehicleInfoTPanel::DrawLockButton
void DrawLockButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1087
RoR::GUI::VehicleInfoTPanel::TPanelMode
TPanelMode
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUI::VehicleInfoTPanel
Definition: GUI_VehicleInfoTPanel.h:34
RoR::GUI::VehicleInfoTPanel::m_a_icon
Ogre::TexturePtr m_a_icon
Definition: GUI_VehicleInfoTPanel.h:139
ForwardDeclarations.h
Global forward declarations.
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_BASICS
@ TPANELFOCUS_BASICS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::DrawBeaconButton
void DrawBeaconButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:975
RoR::GUI::VehicleInfoTPanel::m_physics_icon
Ogre::TexturePtr m_physics_icon
Definition: GUI_VehicleInfoTPanel.h:137
RoR::GUI::VehicleInfoTPanel::m_icons_cached
bool m_icons_cached
Definition: GUI_VehicleInfoTPanel.h:126
RoR::GUI::VehicleInfoTPanel::DrawWarnBlinkerButton
void DrawWarnBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:848
RoR::GUI::VehicleInfoTPanel::m_visibility_mode
TPanelMode m_visibility_mode
Definition: GUI_VehicleInfoTPanel.h:51
RoR::GUI::VehicleInfoTPanel::TPANELMODE_OPAQUE
@ TPANELMODE_OPAQUE
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUI::VehicleInfoTPanel::m_stat_gcur_z
float m_stat_gcur_z
Definition: GUI_VehicleInfoTPanel.h:86
RoR::GUI::VehicleInfoTPanel::TPANELMODE_HIDDEN
@ TPANELMODE_HIDDEN
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUI::VehicleInfoTPanel::CacheIcons
void CacheIcons()
Definition: GUI_VehicleInfoTPanel.cpp:1125
RoR::GUI::VehicleInfoTPanel::m_helptext_fullsize
bool m_helptext_fullsize
Definition: GUI_VehicleInfoTPanel.h:72
RoR::GUI::VehicleInfoTPanel::m_particle_icon
Ogre::TexturePtr m_particle_icon
Definition: GUI_VehicleInfoTPanel.h:143
RoR::GUI::VehicleInfoTPanel::DrawAntiLockBrakeButton
void DrawAntiLockBrakeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:915
RoR::GUI::VehicleInfoTPanel::m_w_icon
Ogre::TexturePtr m_w_icon
Definition: GUI_VehicleInfoTPanel.h:140
RoR::GUI::VehicleInfoTPanel::m_warning_light_icon
Ogre::TexturePtr m_warning_light_icon
Definition: GUI_VehicleInfoTPanel.h:130
RoR::GUI::VehicleInfoTPanel::DrawActorPhysicsButton
void DrawActorPhysicsButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:923
RoR::GUI::VehicleInfoTPanel::DrawSecureButton
void DrawSecureButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1105
RoR::GUI::VehicleInfoTPanel::UpdateStats
void UpdateStats(float dt, ActorPtr actor)
Caution: touches live data, must be synced with sim. thread.
Definition: GUI_VehicleInfoTPanel.cpp:559
RoR::GUI::VehicleInfoTPanel::m_stat_broken_beams
int m_stat_broken_beams
Definition: GUI_VehicleInfoTPanel.h:79
RoR::GUI::VehicleInfoTPanel::m_stat_gmax_x
float m_stat_gmax_x
Definition: GUI_VehicleInfoTPanel.h:87
RoR::GUI::VehicleInfoTPanel::DrawMirrorButton
void DrawMirrorButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:873
RoR::GUI::VehicleInfoTPanel::m_horn_btn_active
bool m_horn_btn_active
Definition: GUI_VehicleInfoTPanel.h:125
RoR::GUI::VehicleInfoTPanel::m_beacons_icon
Ogre::TexturePtr m_beacons_icon
Definition: GUI_VehicleInfoTPanel.h:146
RoR::GUI::VehicleInfoTPanel::m_abs_icon
Ogre::TexturePtr m_abs_icon
Definition: GUI_VehicleInfoTPanel.h:136
RoR::GUI::VehicleInfoTPanel::DrawHornButton
void DrawHornButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:856
RoR::GUI::VehicleInfoTPanel::m_active_commandkey
CommandkeyID_t m_active_commandkey
Definition: GUI_VehicleInfoTPanel.h:65
RoR::GUI::VehicleInfoTPanel::DrawRightBlinkerButton
void DrawRightBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:840
RoR::GUI::VehicleInfoTPanel::m_requested_focus
TPanelFocus m_requested_focus
Requested by SetVisible()
Definition: GUI_VehicleInfoTPanel.h:52
RoR::GUI::VehicleInfoTPanel::m_command_hovered_text_color
ImVec4 m_command_hovered_text_color
Definition: GUI_VehicleInfoTPanel.h:71
RoR::GUI::VehicleInfoTPanel::DrawVehicleCommandsUI
void DrawVehicleCommandsUI(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:201
RefCountingObjectPtr< Actor >
RoR::GUI::VehicleInfoTPanel::m_stat_beam_stress
float m_stat_beam_stress
Definition: GUI_VehicleInfoTPanel.h:81
RoR::GUI::VehicleInfoTPanel::DrawTransferCaseModeButton
void DrawTransferCaseModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:949
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_DIAG
@ TPANELFOCUS_DIAG
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::m_startupdemo_init
bool m_startupdemo_init
Definition: GUI_VehicleInfoTPanel.h:55
RoR::GUI::VehicleInfoTPanel::DrawWheelDiffButton
void DrawWheelDiffButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:940
RoR::GUI::VehicleInfoTPanel::m_stat_gmax_y
float m_stat_gmax_y
Definition: GUI_VehicleInfoTPanel.h:88
RoR::GUI::VehicleInfoTPanel::m_stat_gmax_z
float m_stat_gmax_z
Definition: GUI_VehicleInfoTPanel.h:89
RoR::GUI::VehicleInfoTPanel::m_headlight_icon
Ogre::TexturePtr m_headlight_icon
Definition: GUI_VehicleInfoTPanel.h:127
RoR::CommandkeyID_t
int CommandkeyID_t
Index into Actor::ar_commandkeys (BEWARE: indexed 1-MAX_COMMANDKEYS, 0 is invalid value,...
Definition: ForwardDeclarations.h:74
RoR::GUI::VehicleInfoTPanel::m_left_blinker_icon
Ogre::TexturePtr m_left_blinker_icon
Definition: GUI_VehicleInfoTPanel.h:128
RoR::GUI::VehicleInfoTPanel::m_horn_icon
Ogre::TexturePtr m_horn_icon
Definition: GUI_VehicleInfoTPanel.h:131
RoR::GUI::VehicleInfoTPanel::m_actor_physics_icon
Ogre::TexturePtr m_actor_physics_icon
Definition: GUI_VehicleInfoTPanel.h:138
RoR::GUI::VehicleInfoTPanel::m_cmdbeam_highlight_color
ImVec4 m_cmdbeam_highlight_color
Definition: GUI_VehicleInfoTPanel.h:68
RoR::GUI::VehicleInfoTPanel::m_cmdbeam_highlight_thickness
float m_cmdbeam_highlight_thickness
Definition: GUI_VehicleInfoTPanel.h:70
RoR::GUI::VehicleInfoTPanel::DrawVehicleDiagUI
void DrawVehicleDiagUI(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:499
RoR::GUI::VehicleInfoTPanel::m_parking_brake_icon
Ogre::TexturePtr m_parking_brake_icon
Definition: GUI_VehicleInfoTPanel.h:134
RoR::GUI::VehicleInfoTPanel::DrawVehicleCommandHighlights
void DrawVehicleCommandHighlights(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:779
RoR::GUI::VehicleInfoTPanel::m_stat_gcur_x
float m_stat_gcur_x
Definition: GUI_VehicleInfoTPanel.h:84
RoR::GUI::VehicleInfoTPanel::DrawParticlesButton
void DrawParticlesButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:967
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_STATS
@ TPANELFOCUS_STATS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::DrawCameraButton
void DrawCameraButton()
Definition: GUI_VehicleInfoTPanel.cpp:1076
RoR::GUI::VehicleInfoTPanel::m_transluc_textdis_color
ImVec4 m_transluc_textdis_color
Definition: GUI_VehicleInfoTPanel.h:57
RoR::GUI::VehicleInfoTPanel::m_stat_avg_deform
float m_stat_avg_deform
Definition: GUI_VehicleInfoTPanel.h:83
RoR::GUI::VehicleInfoTPanel::IsHornButtonActive
bool IsHornButtonActive() const
Definition: GUI_VehicleInfoTPanel.h:43
RoR::GUI::VehicleInfoTPanel::m_current_focus
TPanelFocus m_current_focus
Updated based on currently open tab.
Definition: GUI_VehicleInfoTPanel.h:53
RoR::GUI::VehicleInfoTPanel::m_engine_icon
Ogre::TexturePtr m_engine_icon
Definition: GUI_VehicleInfoTPanel.h:145
RoR::GUI::VehicleInfoTPanel::m_camera_icon
Ogre::TexturePtr m_camera_icon
Definition: GUI_VehicleInfoTPanel.h:147
RoR::GUI::VehicleInfoTPanel::m_cruise_control_icon
Ogre::TexturePtr m_cruise_control_icon
Definition: GUI_VehicleInfoTPanel.h:150
RoR::GUI::VehicleInfoTPanel::DrawParkingBrakeButton
void DrawParkingBrakeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:899
RoR::GUI::VehicleInfoTPanel::DrawCustomLightButton
void DrawCustomLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1025
RoR::GUI::VehicleInfoTPanel::m_shift_icon
Ogre::TexturePtr m_shift_icon
Definition: GUI_VehicleInfoTPanel.h:144
RoR::GUI::VehicleInfoTPanel::DrawTransferCaseGearRatioButton
void DrawTransferCaseGearRatioButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:958
RoR::GUI::VehicleInfoTPanel::m_cmdbeam_ui_rect_thickness
float m_cmdbeam_ui_rect_thickness
Definition: GUI_VehicleInfoTPanel.h:69
RoR::GUI::VehicleInfoTPanel::m_startupdemo_timer
Ogre::Timer m_startupdemo_timer
Definition: GUI_VehicleInfoTPanel.h:54
RoR::GUI::VehicleInfoTPanel::TPANELMODE_TRANSLUCENT
@ TPANELMODE_TRANSLUCENT
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUI::VehicleInfoTPanel::m_g_icon
Ogre::TexturePtr m_g_icon
Definition: GUI_VehicleInfoTPanel.h:142
RoR::GUI::VehicleInfoTPanel::DrawTractionControlButton
void DrawTractionControlButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:907
RoR::GUI::VehicleInfoTPanel::DrawShiftModeButton
void DrawShiftModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:983
RoR::GUI::VehicleInfoTPanel::DrawVehicleBasicsUI
void DrawVehicleBasicsUI(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:617
RoR::GUI::VehicleInfoTPanel::DrawAxleDiffButton
void DrawAxleDiffButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:931
RoR::GUI::VehicleInfoTPanel::m_stat_gcur_y
float m_stat_gcur_y
Definition: GUI_VehicleInfoTPanel.h:85
RoR::GUI::VehicleInfoTPanel::m_mirror_icon
Ogre::TexturePtr m_mirror_icon
Definition: GUI_VehicleInfoTPanel.h:132
RoR::GfxActor
Definition: GfxActor.h:52
RoR::GUI::VehicleInfoTPanel::Draw
void Draw(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:43
RoR::GUI::VehicleInfoTPanel::m_panel_translucent_color
ImVec4 m_panel_translucent_color
Definition: GUI_VehicleInfoTPanel.h:56
RoR::GUI::VehicleInfoTPanel::m_lock_icon
Ogre::TexturePtr m_lock_icon
Definition: GUI_VehicleInfoTPanel.h:148
RoR::GUI::VehicleInfoTPanel::m_repair_icon
Ogre::TexturePtr m_repair_icon
Definition: GUI_VehicleInfoTPanel.h:133
RoR::GUI::VehicleInfoTPanel::m_secure_icon
Ogre::TexturePtr m_secure_icon
Definition: GUI_VehicleInfoTPanel.h:149
RoR::GUI::VehicleInfoTPanel::SetVisible
void SetVisible(TPanelMode mode, TPanelFocus focus=TPANELFOCUS_NONE)
Definition: GUI_VehicleInfoTPanel.cpp:553
RoR::GUI::VehicleInfoTPanel::DrawLeftBlinkerButton
void DrawLeftBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:832
RoR::GUI::VehicleInfoTPanel::DrawCruiseControlButton
void DrawCruiseControlButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1117
RoR::GUI::VehicleInfoTPanel::m_right_blinker_icon
Ogre::TexturePtr m_right_blinker_icon
Definition: GUI_VehicleInfoTPanel.h:129
RoR::GUI::VehicleInfoTPanel::m_stat_mass_Kg
float m_stat_mass_Kg
Definition: GUI_VehicleInfoTPanel.h:82
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_COMMANDS
@ TPANELFOCUS_COMMANDS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::DrawVehicleStatsUI
void DrawVehicleStatsUI(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:378
RoR::GUI::VehicleInfoTPanel::m_hovered_commandkey
CommandkeyID_t m_hovered_commandkey
Definition: GUI_VehicleInfoTPanel.h:66
RoR::GUI::VehicleInfoTPanel::m_traction_control_icon
Ogre::TexturePtr m_traction_control_icon
Definition: GUI_VehicleInfoTPanel.h:135
RoR
Definition: AppContext.h:36
RoR::COMMANDKEYID_INVALID
static const CommandkeyID_t COMMANDKEYID_INVALID
Definition: ForwardDeclarations.h:75
RoR::GUI::VehicleInfoTPanel::GetActiveCommandKey
CommandkeyID_t GetActiveCommandKey() const
Definition: GUI_VehicleInfoTPanel.h:42
RoR::GUI::VehicleInfoTPanel::DrawHeadLightButton
void DrawHeadLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:824