Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
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
31namespace RoR {
32namespace GUI {
33
35{
36public:
39
43 bool IsHornButtonActive() const { return m_horn_btn_active; }
44
45 void UpdateStats(float dt, ActorPtr actor);
46 void Draw(RoR::GfxActor* actorx);
47
48private:
55 bool m_startupdemo_init = false;
56 ImVec4 m_panel_translucent_color = ImVec4(0.1f, 0.1f, 0.1f, 0.5f);
57 ImVec4 m_panel_transluc_scrollbar_bg = ImVec4(0.1f, 0.1f, 0.1f, 0.4f); // Drawn on top of semi-transparent panel, make it just a shade
58 ImVec4 m_transluc_textdis_color = ImVec4(0.64f, 0.64f, 0.63f, 1.f);
59 float GetPanelWidth();
60 void BeginTabContents();
61 void EndTabContents();
64
70
73
74 ImVec4 m_cmdbeam_highlight_color = ImVec4(0.733f, 1.f, 0.157f, 0.745f);
77 ImVec4 m_command_hovered_text_color = ImVec4(0.1f, 0.1f, 0.1f, 1.f);
78 bool m_helptext_fullsize = false;
81
85 float m_stat_health = 0.f;
88 float m_stat_beam_stress = 0.f;
89 float m_stat_mass_Kg = 0.f;
90 float m_stat_avg_deform = 0.f;
91 float m_stat_gcur_x = 0.f;
92 float m_stat_gcur_y = 0.f;
93 float m_stat_gcur_z = 0.f;
94 float m_stat_gmax_x = 0.f;
95 float m_stat_gmax_y = 0.f;
96 float m_stat_gmax_z = 0.f;
98
101 void DrawVehicleDiagUI(RoR::GfxActor* actorx);
103
111 void DrawHornButton(RoR::GfxActor* actorx);
112 void DrawMirrorButton(RoR::GfxActor* actorx);
113 void DrawRepairButton(RoR::GfxActor* actorx);
118 void DrawAxleDiffButton(RoR::GfxActor* actorx);
123 void DrawBeaconButton(RoR::GfxActor* actorx);
125 void DrawEngineButton(RoR::GfxActor* actorx);
127 void DrawLockButton(RoR::GfxActor* actorx);
128 void DrawSecureButton(RoR::GfxActor* actorx);
130 void DrawCameraButton();
132 void CacheIcons();
133 bool m_horn_btn_active = false;
134 bool m_icons_cached = false;
135 Ogre::TexturePtr m_headlight_icon;
136 Ogre::TexturePtr m_left_blinker_icon;
137 Ogre::TexturePtr m_right_blinker_icon;
138 Ogre::TexturePtr m_warning_light_icon;
139 Ogre::TexturePtr m_horn_icon;
140 Ogre::TexturePtr m_mirror_icon;
141 Ogre::TexturePtr m_repair_icon;
142 Ogre::TexturePtr m_parking_brake_icon;
143 Ogre::TexturePtr m_traction_control_icon;
144 Ogre::TexturePtr m_abs_icon;
145 Ogre::TexturePtr m_physics_icon;
146 Ogre::TexturePtr m_actor_physics_icon;
147 Ogre::TexturePtr m_a_icon;
148 Ogre::TexturePtr m_w_icon;
149 Ogre::TexturePtr m_m_icon;
150 Ogre::TexturePtr m_g_icon;
151 Ogre::TexturePtr m_particle_icon;
152 Ogre::TexturePtr m_shift_icon;
153 Ogre::TexturePtr m_engine_icon;
154 Ogre::TexturePtr m_beacons_icon;
155 Ogre::TexturePtr m_camera_icon;
156 Ogre::TexturePtr m_lock_icon;
157 Ogre::TexturePtr m_secure_icon;
158 Ogre::TexturePtr m_cruise_control_icon;
160};
161
162
163
164} // namespace GUI
165} // namespace RoR
Global forward declarations.
void DrawVehicleStatsUI(RoR::GfxActor *actorx)
void DrawEngineButton(RoR::GfxActor *actorx)
CommandkeyID_t GetActiveCommandKey() const
void DrawWarnBlinkerButton(RoR::GfxActor *actorx)
void SetVisible(TPanelMode mode, TPanelFocus focus=TPANELFOCUS_NONE)
void DrawVehicleCommandsUI(RoR::GfxActor *actorx)
void UpdateStats(float dt, ActorPtr actor)
Caution: touches live data, must be synced with sim. thread.
void DrawSecureButton(RoR::GfxActor *actorx)
void DrawParkingBrakeButton(RoR::GfxActor *actorx)
void DrawVehicleDiagUI(RoR::GfxActor *actorx)
void DrawLeftBlinkerButton(RoR::GfxActor *actorx)
void DrawParticlesButton(RoR::GfxActor *actorx)
void DrawRepairButton(RoR::GfxActor *actorx)
void DrawHornButton(RoR::GfxActor *actorx)
void DrawVehicleHelpTextureFullsize(RoR::GfxActor *actorx)
void DrawMirrorButton(RoR::GfxActor *actorx)
bool IsVisible(TPanelFocus focus=TPANELFOCUS_NONE) const
void DrawHeadLightButton(RoR::GfxActor *actorx)
void DrawBeaconButton(RoR::GfxActor *actorx)
void DrawCruiseControlButton(RoR::GfxActor *actorx)
void DrawActorPhysicsButton(RoR::GfxActor *actorx)
void DrawAxleDiffButton(RoR::GfxActor *actorx)
void DrawVehicleCommandHighlights(RoR::GfxActor *actorx)
void DrawShiftModeButton(RoR::GfxActor *actorx)
void DrawCustomLightButton(RoR::GfxActor *actorx)
void BeginTabContents()
Opens scrollable child window which fits the panel to screen.
TPanelFocus m_current_focus
Updated based on currently open tab.
void DrawLockButton(RoR::GfxActor *actorx)
void Draw(RoR::GfxActor *actorx)
float m_tab_contents_height
Measured on previous frame; 0 = unknown.
ImVec2 m_helptext_fullsize_screenpos
The image is drawn into separate window.
void DrawVehicleBasicsUI(RoR::GfxActor *actorx)
void DrawTransferCaseModeButton(RoR::GfxActor *actorx)
void DrawTransferCaseGearRatioButton(RoR::GfxActor *actorx)
void DrawWheelDiffButton(RoR::GfxActor *actorx)
void DrawAntiLockBrakeButton(RoR::GfxActor *actorx)
void DrawCustomLightButtons(RoR::GfxActor *actorx)
TPanelFocus m_requested_focus
Requested by SetVisible()
void DrawTractionControlButton(RoR::GfxActor *actorx)
void DrawRightBlinkerButton(RoR::GfxActor *actorx)
int CommandkeyID_t
Index into Actor::ar_commandkeys (BEWARE: indexed 1-MAX_COMMANDKEYS, 0 is invalid value,...
static const CommandkeyID_t COMMANDKEYID_INVALID