RigsofRods
Soft-body Physics Simulation
GUI_VehicleInfoTPanel.cpp
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 
22 #include "GUI_VehicleInfoTPanel.h"
23 
24 #include "Application.h"
25 #include "Actor.h"
26 #include "SimData.h"
27 #include "Language.h"
28 #include "EngineSim.h"
29 #include "GameContext.h"
30 #include "GfxActor.h"
31 #include "GUIManager.h"
32 #include "Utils.h"
33 #include "GUIUtils.h"
34 
35 using namespace RoR;
36 using namespace GUI;
37 
38 const float HELP_TEXTURE_WIDTH = 512.f;
39 const float HELP_TEXTURE_HEIGHT = 128.f;
40 const ImVec2 MAX_PREVIEW_SIZE(100.f, 100.f);
41 const float MIN_PANEL_WIDTH = 230.f;
42 
44 {
45  // === DETERMINE VISIBILITY ===
46 
47  // Show only once for 5 sec, with a notice
48  bool show_translucent = false;
49  if (App::ui_show_vehicle_buttons->getBool() && actorx && !m_startupdemo_init)
50  {
51  m_startupdemo_timer.reset();
53  fmt::format(_LC("VehicleButtons", "Hover the mouse on the left to see controls")), "lightbulb.png");
54  m_startupdemo_init = true;
55  }
56  if (App::ui_show_vehicle_buttons->getBool() && m_startupdemo_timer.getMilliseconds() < 5000)
57  {
58  show_translucent = true;
59  }
60 
61  // Show when mouse is on the left of screen
63  && App::ui_show_vehicle_buttons->getBool()
64  && App::GetGuiManager()->AreStaticMenusAllowed()
65  && (ImGui::GetIO().MousePos.x <= MIN_PANEL_WIDTH + ImGui::GetStyle().WindowPadding.x*2))
66  {
67  show_translucent = true;
68  }
69 
70  if (show_translucent && m_visibility_mode != TPANELMODE_OPAQUE)
71  {
73  }
74  else if (!show_translucent && m_visibility_mode != TPANELMODE_OPAQUE)
75  {
77  }
78 
80  {
81  return;
82  }
83 
84  // === OPEN IMGUI WINDOW ===
85 
87 
88  ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse |
89  ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar;
90 
91  ImGui::SetNextWindowPos(ImVec2(theme.screen_edge_padding.x, (theme.screen_edge_padding.y + 110)));
92  ImGui::SetNextWindowContentWidth(MIN_PANEL_WIDTH);
93  switch (m_visibility_mode)
94  {
95  case TPANELMODE_OPAQUE:
96  ImGui::PushStyleColor(ImGuiCol_WindowBg, theme.semitransparent_window_bg);
97  ImGui::PushStyleColor(ImGuiCol_TextDisabled, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
98  break;
99 
101  ImGui::PushStyleColor(ImGuiCol_WindowBg, m_panel_translucent_color);
102  ImGui::PushStyleColor(ImGuiCol_TextDisabled, m_transluc_textdis_color);
103  break;
104 
105  default:
106  break;
107  }
108  ImGui::Begin("VehicleInfoTPanel", nullptr, flags);
109 
110  // === DECIDE WHAT THE WINDOW WILL DISPLAY ===
111 
112  int tabflags_basics = ImGuiTabItemFlags_None;
113  int tabflags_stats = ImGuiTabItemFlags_None;
114  int tabflags_commands = ImGuiTabItemFlags_None;
115  int tabflags_diag = ImGuiTabItemFlags_None;
117  {
118  switch (m_requested_focus)
119  {
120  case TPANELFOCUS_BASICS: tabflags_basics = ImGuiTabItemFlags_SetSelected; break;
121  case TPANELFOCUS_STATS: tabflags_stats = ImGuiTabItemFlags_SetSelected; break;
122  case TPANELFOCUS_DIAG: tabflags_diag = ImGuiTabItemFlags_SetSelected; break;
123  case TPANELFOCUS_COMMANDS: tabflags_commands = ImGuiTabItemFlags_SetSelected; break;
124  default:;
125  }
126 
127  // Reset the request
129  }
130 
131  // === DRAW THE WINDOW HEADER - MINI IMAGE (if available) AND VEHICLE NAME ===
132 
133  ImVec2 name_pos = ImGui::GetCursorPos();
134  ImVec2 tabs_pos;
135  if (actorx->GetActor()->getUsedActorEntry()->filecachename != "")
136  {
137  Ogre::TexturePtr preview_tex = Ogre::TextureManager::getSingleton().load(
139  // Scale the image
140  ImVec2 MAX_PREVIEW_SIZE(100.f, 100.f);
141  ImVec2 size(preview_tex->getWidth(), preview_tex->getHeight());
142  size *= MAX_PREVIEW_SIZE.x / size.x; // Fit size along X
143  if (size.y > MAX_PREVIEW_SIZE.y) // Reduce size along Y if needed
144  {
145  size *= MAX_PREVIEW_SIZE.y / size.y;
146  }
147  // Draw the image
148  ImGui::Image(reinterpret_cast<ImTextureID>(preview_tex->getHandle()), size);
149  tabs_pos = ImGui::GetCursorPos();
150  // Move name to the right
151  name_pos.x += size.x + ImGui::GetStyle().ItemSpacing.x;
152  ImGui::SetCursorPos(name_pos);
153  }
154 
156 
157  // === DRAW TAB BAR ===
158 
159  if (actorx->GetActor()->getUsedActorEntry()->filecachename != "")
160  {
161  ImGui::SetCursorPos(tabs_pos);
162  }
163  ImGui::BeginTabBar("VehicleInfoTPanelTabs", ImGuiTabBarFlags_None);
164  if (ImGui::BeginTabItem(_LC("TPanel", "Basics"), nullptr, tabflags_basics))
165  {
167  this->DrawVehicleBasicsUI(actorx);
168 
169  ImGui::EndTabItem();
170  }
171  if (ImGui::BeginTabItem(_LC("TPanel", "Stats"), nullptr, tabflags_stats))
172  {
174  this->DrawVehicleStatsUI(actorx);
175 
176  ImGui::EndTabItem();
177  }
178  if (ImGui::BeginTabItem(_LC("TPanel", "Commands"), nullptr, tabflags_commands))
179  {
181  this->DrawVehicleCommandsUI(actorx);
182 
183  ImGui::EndTabItem();
184  }
185  if (ImGui::BeginTabItem(_LC("TPanel", "Diag"), nullptr, tabflags_diag))
186  {
188  this->DrawVehicleDiagUI(actorx);
189 
190  ImGui::EndTabItem();
191  }
192 
193  ImGui::EndTabBar();
194 
195  ImGui::End();
196  ImGui::PopStyleColor(2); // WindowBg, TextDisabled
197 
198  this->DrawVehicleCommandHighlights(actorx);
199 }
200 
202 {
203  // === DRAW DESCRIPTION (if available) ===
204 
205  if (!actorx->GetActor()->getDescription().empty())
206  {
207  ImGui::TextDisabled("%s", _LC("VehicleDescription", "Description text:"));
208  for (auto line : actorx->GetActor()->getDescription())
209  {
210  ImGui::TextWrapped("%s", line.c_str());
211  }
212  }
213 
214  // === DRAW HELP TEXTURE (if available) ===
215 
216  if (actorx->GetHelpTex())
217  {
218  ImGui::TextDisabled("%s", _LC("VehicleDescription", "Help image:"));
219  ImGui::SameLine();
220  ImGui::SetCursorPosX(MIN_PANEL_WIDTH - (ImGui::CalcTextSize(_LC("VehicleDescription", "Full size")).x + 25.f));
221  ImGui::Checkbox(_LC("VehicleDescription", "Full size"), &m_helptext_fullsize);
222 
223  ImTextureID im_tex = reinterpret_cast<ImTextureID>(actorx->GetHelpTex()->getHandle());
225  {
226  ImGui::Image(im_tex, ImVec2(HELP_TEXTURE_WIDTH, HELP_TEXTURE_HEIGHT));
227  }
228  else
229  {
230  ImGui::Image(im_tex, ImVec2(MIN_PANEL_WIDTH, HELP_TEXTURE_HEIGHT));
231  }
232  }
233 
234  // === DRAW COMMAND KEYS, WITH HIGHLIGHT ===
235 
238 
239  if (actorx->GetActor()->ar_unique_commandkey_pairs.size() > 0)
240  {
241  ImGui::TextDisabled("%s", _LC("VehicleDescription", "Command controls:"));
242  ImGui::PushStyleColor(ImGuiCol_Text, m_cmdbeam_highlight_color);
243  ImGui::Text("%s", _LC("VehicleDescription", "Hover controls for on-vehicle highlight"));
244  ImGui::PopStyleColor(1); // Text
245 
246  for (const UniqueCommandKeyPair& qpair: actorx->GetActor()->ar_unique_commandkey_pairs)
247  {
248  // Calc key-button sizes for right alignment (also to check if they fit on the description line)
249  ImVec2 initial_cursor = ImGui::GetCursorScreenPos();
250  const RoR::events event1 = (RoR::events)RoR::InputEngine::resolveEventName(fmt::format("COMMANDS_{:02d}", qpair.uckp_key1));
251  const RoR::events event2 = (RoR::events)RoR::InputEngine::resolveEventName(fmt::format("COMMANDS_{:02d}", qpair.uckp_key2));
252  std::string desc = qpair.uckp_description;
253  if (qpair.uckp_description == "")
254  {
255  desc = _LC("VehicleDescription", "~unlabeled~");
256  }
257  ImVec2 key1_size = ImCalcEventHighlightedSize(event1);
258  ImVec2 key2_size = ImCalcEventHighlightedSize(event2);
259  ImVec2 desc_size = ImGui::CalcTextSize(desc.c_str());
260  const bool single_line = ImGui::GetWindowContentRegionMax().x > desc_size.x + key1_size.x + key2_size.x;
261  static const float BUMP_HEIGHT = 3.f;
262  static const float MOUSEHIGHLIGHT_MAGICPADRIGHT = 4.f;
263 
264  // The line-highlighting: Done manually because `ImGui::Selectable()` blocks buttons under it (or gets blocked by buttons with the `_AllowItemOverlap` flag).
265  ImVec2 highlight_mouse_min = initial_cursor - ImGui::GetStyle().ItemSpacing/2;
266  ImVec2 highlight_mouse_max = highlight_mouse_min + ImVec2(ImGui::GetWindowContentRegionWidth()+MOUSEHIGHLIGHT_MAGICPADRIGHT, ImGui::GetTextLineHeightWithSpacing());
267  if (!single_line)
268  {
269  highlight_mouse_max.y += ImGui::GetTextLineHeightWithSpacing() - BUMP_HEIGHT;
270  }
271 
272  if ((ImGui::GetMousePos().x > highlight_mouse_min.x && ImGui::GetMousePos().y > highlight_mouse_min.y)
273  && (ImGui::GetMousePos().x < highlight_mouse_max.x && ImGui::GetMousePos().y < highlight_mouse_max.y))
274  {
275  // This is only for the command-highlight HUD; key1/key2 both point to the same command beams.
276  m_hovered_commandkey = qpair.uckp_key1;
277 
278  // Draw the highlight
279  ImVec4 col = m_cmdbeam_highlight_color;
280  col.w = 0.55f;
281  ImDrawList* draw_list = ImGui::GetWindowDrawList();
282  draw_list->AddRectFilled(highlight_mouse_min, highlight_mouse_max, ImColor(col));
283 
284  // Description comes first - colored for contrast
285  ImGui::TextColored(m_command_hovered_text_color, "%s", desc.c_str());
286  }
287  else
288  {
289  // Description comes first
290  ImGui::Text("%s", desc.c_str());
291  }
292 
293 
294  if (single_line)
295  {
296  ImGui::SameLine(); // They fit!
297  }
298  else
299  {
300  ImGui::SetCursorPos(ImGui::GetCursorPos() + ImVec2(0.f, -BUMP_HEIGHT)); // They must go below, but bump them up a bit
301  }
302 
303  // Key 1
304  bool key1_hovered = false;
305  bool key1_active = false;
306  ImGui::SetCursorPosX((ImGui::GetWindowContentRegionMax().x) - key1_size.x - key2_size.x - ImGui::GetStyle().ItemSpacing.x);
307  ImDrawEventHighlightedButton(event1, &key1_hovered, &key1_active);
308  if (key1_active)
309  {
310  m_active_commandkey = qpair.uckp_key1;
311  }
312  if (key1_hovered)
313  {
314  m_hovered_commandkey = qpair.uckp_key1;
315  }
316  ImGui::SameLine();
317 
318  // Key 2
319  ImGui::SetCursorPosX((ImGui::GetWindowContentRegionMax().x) - key2_size.x);
320  bool key2_hovered = false;
321  bool key2_active = false;
322  ImDrawEventHighlightedButton(event2, &key2_hovered, &key2_active);
323  if (key2_active)
324  {
325  m_active_commandkey = qpair.uckp_key2;
326  }
327  if (key2_hovered)
328  {
329  m_hovered_commandkey = qpair.uckp_key2;
330  }
331  }
332  }
333 }
334 
335 void DrawStatsLineColored(const char* name, const std::string& value, ImVec4 value_color)
336 {
338  ImGui::TextColored(theme.value_blue_text_color, "%s", name);
339  // If the value is too long, move it to next line
340  ImVec2 label_size = ImGui::CalcTextSize(name);
341  ImVec2 value_size = ImGui::CalcTextSize(value.c_str());
342  float cursor_x_desired = - ImGui::CalcTextSize(value.c_str()).x;
343  if (label_size.x + value_size.x + ImGui::GetStyle().ItemSpacing.x < ImGui::GetWindowContentRegionWidth())
344  {
345  ImGui::SameLine();
346  }
347  ImGui::SetCursorPosX(ImGui::GetWindowContentRegionMax().x - value_size.x);
348  ImGui::TextColored(value_color, "%s", value.c_str());
349 }
350 
351 void DrawStatsLine(const char* name, const std::string& value)
352 {
353  DrawStatsLineColored(name, value, ImGui::GetStyle().Colors[ImGuiCol_Text]);
354 }
355 
356 void DrawStatsBullet(const char* name, const std::string& value)
357 {
359  ImGui::PushStyleColor(ImGuiCol_Text, theme.value_blue_text_color);
360  ImGui::Bullet();
361  ImGui::PopStyleColor(); // Text
362  ImGui::SameLine();
363  DrawStatsLineColored(name, value, ImGui::GetStyle().Colors[ImGuiCol_Text]);
364 }
365 
366 std::string FormatVelocityBySpeedoPreset(float velocity)
367 {
368  if (App::gfx_speedo_imperial->getBool())
369  {
370  return fmt::format("{:.0f} mph", Round(velocity * 2.23693629f));
371  }
372  else
373  {
374  return fmt::format("{:.0f} km/h", Round(velocity * 3.6f));
375  }
376 }
377 
379 {
381  ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(ImGui::GetStyle().ItemSpacing.x, 0));
382 
383  if (m_stat_health < 1.0f)
384  {
385  const float value = static_cast<float>( Round((1.0f - m_stat_health) * 100.0f, 2) );
386  DrawStatsLine(_LC("SimActorStats", "Vehicle health: "), fmt::format("{:.2f}%", value));
387  }
388  else if (m_stat_health >= 1.0f) //When this condition is true, it means that health is at 0% which means 100% of destruction.
389  {
390  DrawStatsLine(_LC("SimActorStats", "Vehicle destruction: "), "100%");
391  }
392 
393  const int num_beams = actorx->GetActor()->ar_num_beams;
394  DrawStatsLine(_LC("SimActorStats", "Beam count: "), fmt::format("{}", num_beams));
395 
396  const float broken_pct = static_cast<float>( Round((float)m_stat_broken_beams / (float)num_beams, 2) * 100.0f );
397  DrawStatsLine(_LC("SimActorStats", "Broken beams count: "), fmt::format("{} ({:.0f}%)", m_stat_broken_beams, broken_pct));
398 
399  const float deform_pct = static_cast<float>( Round((float)m_stat_deformed_beams / (float)num_beams * 100.0f) );
400  DrawStatsLine(_LC("SimActorStats", "Deformed beams count: "), fmt::format("{} ({:.0f}%)", m_stat_deformed_beams, deform_pct));
401 
402  const float avg_deform = static_cast<float>( Round((float)m_stat_avg_deform / (float)num_beams, 4) * 100.0f );
403  DrawStatsLine(_LC("SimActorStats", "Average deformation: "), fmt::format("{:.2f}", avg_deform));
404 
405  const float avg_stress = 1.f - (float)m_stat_beam_stress / (float)num_beams;
406  DrawStatsLine(_LC("SimActorStats", "Average stress: "), fmt::format("{:+08.0f}", avg_stress));
407 
408  ImGui::NewLine();
409 
410  const int num_nodes = actorx->GetActor()->ar_num_nodes;
411  const int num_wheelnodes = actorx->GetActor()->getWheelNodeCount();
412  DrawStatsLine(_LC("SimActorStats", "Node count: "), fmt::format("{} (wheels: {})", num_nodes, num_wheelnodes));
413 
414  DrawStatsLine(_LC("SimActorStats", "Total mass: "), fmt::format("{:8.2f} Kg {:.2f} tons)", m_stat_mass_Kg, m_stat_mass_Kg / 1000.0f));
415 
416  ImGui::NewLine();
417 
418  const float n0_velo_len = actorx->GetSimDataBuffer().simbuf_node0_velo.length();
420  {
421  const double PI = 3.14159265358979323846;
422 
423  const float max_rpm = actorx->GetSimDataBuffer().simbuf_engine_max_rpm;
424  const float torque = actorx->GetSimDataBuffer().simbuf_engine_torque;
425  const float turbo_psi = actorx->GetSimDataBuffer().simbuf_engine_turbo_psi;
426  const float cur_rpm = actorx->GetSimDataBuffer().simbuf_engine_rpm;
427  const float wheel_speed = actorx->GetSimDataBuffer().simbuf_wheel_speed;
428 
429  const ImVec4 rpm_color = (cur_rpm > max_rpm) ? theme.value_red_text_color : ImGui::GetStyle().Colors[ImGuiCol_Text];
430  DrawStatsLineColored(_LC("SimActorStats", "Engine RPM: "), fmt::format("{:.2f} / {:.2f}", cur_rpm, max_rpm), rpm_color);
431 
432  const float inputshaft_rpm = Round(std::max(0.0f, actorx->GetSimDataBuffer().simbuf_inputshaft_rpm));
433  DrawStatsLineColored(_LC("SimActorStats", "Input shaft RPM: "), fmt::format("{:.0f}", inputshaft_rpm), rpm_color);
434 
435  DrawStatsLine(_LC("SimActorStats", "Current torque: "), fmt::format("{:.0f} Nm", Round(torque)));
436 
437  const float currentKw = (((cur_rpm * (torque + ((turbo_psi * 6.8) * torque) / 100) * ( PI / 30)) / 1000));
438  DrawStatsLine(_LC("SimActorStats", "Current power: "), fmt::format("{:.0f}hp ({:.0f}Kw)", Round(currentKw *1.34102209), Round(currentKw)));
439 
440  DrawStatsLine(_LC("SimActorStats", "Current gear: "), fmt::format("{}", actorx->GetSimDataBuffer().simbuf_gear));
441 
442  DrawStatsLine(_LC("SimActorStats", "Drive ratio: "), fmt::format("{:.2f}:1", actorx->GetSimDataBuffer().simbuf_drive_ratio));
443 
444  DrawStatsLine(_LC("SimActorStats", "Wheel speed: "), FormatVelocityBySpeedoPreset(wheel_speed));
445 
446  DrawStatsLine(_LC("SimActorStats", "Vehicle speed: "), FormatVelocityBySpeedoPreset(n0_velo_len));
447  }
448  else // Aircraft or boat
449  {
450  float speedKN = n0_velo_len * 1.94384449f;
451  DrawStatsLine(_LC("SimActorStats", "Current speed: "), fmt::format("{:.0f} kn ({})", Round(speedKN), FormatVelocityBySpeedoPreset(n0_velo_len)));
452 
453  if (actorx->GetSimDataBuffer().simbuf_driveable == AIRPLANE)
454  {
455  const float altitude = actorx->GetSimNodeBuffer()[0].AbsPosition.y / 30.48 * 100;
456  DrawStatsLine(_LC("SimActorStats", "Altitude: "), fmt::format("{:.0f} feet ({:.0f} meters)", Round(altitude), Round(altitude * 0.30480)));
457 
458  int engine_num = 1; // UI; count from 1
460  {
461  std::string label = fmt::format("{} #{}:", _LC("SimActorStats", "Engine "), engine_num);
462  if (ae.simbuf_ae_type == AeroEngineType::AE_XPROP) // Turboprop/pistonprop
463  {
464  DrawStatsLine(label.c_str(), fmt::format("{:.2f} RPM", ae.simbuf_ae_rpm));
465  }
466  else // Turbojet
467  {
468  DrawStatsLine(label.c_str(), fmt::format("{:.2f}", ae.simbuf_ae_rpm));
469  }
470  ++engine_num;
471  }
472  }
473  else if (actorx->GetSimDataBuffer().simbuf_driveable == BOAT)
474  {
475  int engine_num = 1; // UI; count from 1
476  for (ScrewpropSB& screw: actorx->GetSimDataBuffer().simbuf_screwprops)
477  {
478  std::string label = fmt::format("{} #{}:", _LC("SimActorStats", "Engine "), engine_num);
479  DrawStatsLine(label.c_str(), fmt::format("{:.2f}", screw.simbuf_sp_throttle));
480  ++engine_num;
481  }
482  }
483  }
484 
485  ImGui::NewLine();
486 
487  DrawStatsLine(_LC("SimActorStats", "Top speed: "), FormatVelocityBySpeedoPreset(actorx->GetSimDataBuffer().simbuf_top_speed));
488 
489  ImGui::NewLine();
490 
491  DrawStatsLine(_LC("SimActorStats", "G-Forces:"), "");
492  DrawStatsBullet("Vertical:", fmt::format("{: 6.2f}g ({:1.2f}g)", m_stat_gcur_x, m_stat_gmax_x));
493  DrawStatsBullet("Sagittal:", fmt::format("{: 6.2f}g ({:1.2f}g)", m_stat_gcur_y, m_stat_gmax_y));
494  DrawStatsBullet("Lateral:", fmt::format("{: 6.2f}g ({:1.2f}g)", m_stat_gcur_z, m_stat_gmax_z));
495 
496  ImGui::PopStyleVar(); // ItemSpacing
497 }
498 
500 {
501  ImGui::TextDisabled("%s", _LC("TopMenubar", "Live diagnostic views:"));
502  ImGui::TextDisabled("%s", fmt::format(_LC("TopMenubar", "(Toggle with {})"), App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_DEBUG_VIEW)).c_str());
503  ImGui::TextDisabled("%s", fmt::format(_LC("TopMenubar", "(Cycle with {})"), App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_CYCLE_DEBUG_VIEWS)).c_str());
504 
505  int debug_view_type = static_cast<int>(actorx->GetDebugView());
506  ImGui::RadioButton(_LC("TopMenubar", "Normal view"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_NONE));
507  ImGui::RadioButton(_LC("TopMenubar", "Skeleton view"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_SKELETON));
508  ImGui::RadioButton(_LC("TopMenubar", "Node details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_NODES));
509  ImGui::RadioButton(_LC("TopMenubar", "Beam details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_BEAMS));
510  ActorPtr current_actor = actorx->GetActor();
511  if (current_actor->ar_num_wheels > 0)
512  {
513  ImGui::RadioButton(_LC("TopMenubar", "Wheel details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_WHEELS));
514  }
515  if (current_actor->ar_num_shocks > 0)
516  {
517  ImGui::RadioButton(_LC("TopMenubar", "Shock details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_SHOCKS));
518  }
519  if (current_actor->ar_num_rotators > 0)
520  {
521  ImGui::RadioButton(_LC("TopMenubar", "Rotator details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_ROTATORS));
522  }
523  if (current_actor->hasSlidenodes())
524  {
525  ImGui::RadioButton(_LC("TopMenubar", "Slidenode details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_SLIDENODES));
526  }
527  if (current_actor->ar_num_cabs > 0)
528  {
529  ImGui::RadioButton(_LC("TopMenubar", "Submesh details"), &debug_view_type, static_cast<int>(DebugViewType::DEBUGVIEW_SUBMESH));
530  }
531 
532  if ((current_actor != nullptr) && (debug_view_type != static_cast<int>(current_actor->GetGfxActor()->GetDebugView())))
533  {
534  current_actor->GetGfxActor()->SetDebugView(static_cast<DebugViewType>(debug_view_type));
535  }
536 
537  if (debug_view_type >= 1 && debug_view_type <= static_cast<int>(DebugViewType::DEBUGVIEW_BEAMS))
538  {
539  ImGui::Separator();
540  ImGui::TextDisabled("%s", _LC("TopMenubar", "Settings:"));
541  DrawGCheckbox(App::diag_hide_broken_beams, _LC("TopMenubar", "Hide broken beams"));
542  DrawGCheckbox(App::diag_hide_beam_stress, _LC("TopMenubar", "Hide beam stress"));
543  DrawGCheckbox(App::diag_hide_wheels, _LC("TopMenubar", "Hide wheels"));
544  DrawGCheckbox(App::diag_hide_nodes, _LC("TopMenubar", "Hide nodes"));
545  if (debug_view_type >= 2)
546  {
547  DrawGCheckbox(App::diag_hide_wheel_info, _LC("TopMenubar", "Hide wheel info"));
548  }
549  }
550 
551 }
552 
554 {
555  m_visibility_mode = mode;
556  m_requested_focus = focus; // Cannot be handled here, must be handled in Draw() while window is open.
557 }
558 
560 {
561  //taken from TruckHUD.cpp (now removed)
562  beam_t* beam = actor->ar_beams;
563  float average_deformation = 0.0f;
564  float beamstress = 0.0f;
565  float mass = actor->getTotalMass();
566  int beambroken = 0;
567  int beamdeformed = 0;
568  Ogre::Vector3 gcur = actor->getGForces();
569  Ogre::Vector3 gmax = actor->getMaxGForces();
570 
571  for (int i = 0; i < actor->ar_num_beams; i++ , beam++)
572  {
573  if (beam->bm_broken != 0)
574  {
575  beambroken++;
576  }
577  beamstress += std::abs(beam->stress);
578  float current_deformation = fabs(beam->L - beam->refL);
579  if (fabs(current_deformation) > 0.0001f && beam->bm_type != BEAM_HYDRO)
580  {
581  beamdeformed++;
582  }
583  average_deformation += current_deformation;
584  }
585 
586  m_stat_health = ((float)beambroken / (float)actor->ar_num_beams) * 10.0f + ((float)beamdeformed / (float)actor->ar_num_beams);
587  m_stat_broken_beams = beambroken;
588  m_stat_deformed_beams = beamdeformed;
589  m_stat_beam_stress = beamstress;
590  m_stat_mass_Kg = mass;
591  m_stat_avg_deform = average_deformation;
592  m_stat_gcur_x = gcur.x;
593  m_stat_gcur_y = gcur.y;
594  m_stat_gcur_z = gcur.z;
595  m_stat_gmax_x = gmax.x;
596  m_stat_gmax_y = gmax.y;
597  m_stat_gmax_z = gmax.z;
598 }
599 
600 // --------------------------------
601 // class VehicleInfoTPanel
602 
603 const ImVec2 BUTTON_SIZE(18, 18);
604 const ImVec2 BUTTON_OFFSET(0, 3.f);
605 const float BUTTON_Y_OFFSET = 0.f;
606 const ImVec2 BUTTONDUMMY_SIZE(18, 1);
607 
608 void DrawSingleBulletRow(const char* name, RoR::events ev)
609 {
610  ImGui::Dummy(BUTTONDUMMY_SIZE); ImGui::SameLine(); ImGui::Bullet(); ImGui::Text("%s", name);
611  ImGui::SameLine();
612  const ImVec2 btn_size = ImCalcEventHighlightedSize(ev);
613  ImGui::SetCursorPosX(ImGui::GetWindowContentRegionWidth() - btn_size.x);
615 }
616 
618 {
620 
621  if (!m_icons_cached)
622  {
623  this->CacheIcons();
624  }
625 
626  ImGui::TextDisabled("Simulation:");
627  this->DrawRepairButton(actorx);
628  this->DrawActorPhysicsButton(actorx);
629 
630  int num_headlights = actorx->GetActor()->countFlaresByType(FlareType::HEADLIGHT);
631  int num_taillights = actorx->GetActor()->countFlaresByType(FlareType::TAIL_LIGHT);
632  int num_blinkleft = actorx->GetActor()->countFlaresByType(FlareType::BLINKER_LEFT);
633  int num_blinkright = actorx->GetActor()->countFlaresByType(FlareType::BLINKER_RIGHT);
634  int num_beacons = actorx->countBeaconProps();
635  bool has_horn = actorx->GetActor()->getTruckType() == TRUCK;
636  if (num_headlights || num_taillights || num_blinkleft || num_blinkright || num_beacons || has_horn)
637  {
638  ImGui::TextDisabled("Lights and signals:");
639  if (num_headlights || num_taillights)
640  {
641  this->DrawHeadLightButton(actorx);
642  }
643  if (num_blinkleft)
644  {
645  this->DrawLeftBlinkerButton(actorx);
646  }
647  if (num_blinkright)
648  {
649  this->DrawRightBlinkerButton(actorx);
650  }
651  if (num_blinkright || num_blinkleft)
652  {
653  this->DrawWarnBlinkerButton(actorx);
654  }
655  if (num_beacons)
656  {
657  this->DrawBeaconButton(actorx);
658  }
659  if (has_horn)
660  {
661  this->DrawHornButton(actorx);
662  }
663  }
664 
665  const bool has_engine = actorx->GetActor()->ar_engine != nullptr;
666  const bool engine_running = has_engine && actorx->GetActor()->ar_engine->isRunning();
667  const bool has_transfercase = actorx->GetActor()->getTransferCaseMode() != nullptr;
668  const bool has_4wd = has_transfercase && actorx->GetActor()->getTransferCaseMode()->tr_ax_2 != -1;
669  const bool has_2wd = has_transfercase && actorx->GetActor()->getTransferCaseMode()->tr_2wd;
670  const size_t num_tc_gears = (has_transfercase) ? actorx->GetActor()->getTransferCaseMode()->tr_gear_ratios.size() : 0u;
671  if (has_engine)
672  {
673  ImGui::TextDisabled("Engine:");
674  this->DrawEngineButton(actorx);
675  if (!engine_running)
676  {
678  }
679  if (has_transfercase && has_4wd && has_2wd)
680  {
681  this->DrawTransferCaseModeButton(actorx);
682  }
683  if (has_transfercase && num_tc_gears > 1)
684  {
685  this->DrawTransferCaseGearRatioButton(actorx);
686  }
687 
688  this->DrawShiftModeButton(actorx);
689 
690  switch (actorx->GetActor()->ar_engine->GetAutoShiftMode())
691  {
695  break;
700  break;
706  break;
708  break;
710  break;
711  }
712 
713  }
714 
715  const int num_axlediffs = actorx->GetActor()->getAxleDiffMode();
716  const int num_wheeldiffs = actorx->GetActor()->getWheelDiffMode();
717  const bool tc_visible = !actorx->GetActor()->tc_nodash;
718  const bool alb_visible = !actorx->GetActor()->alb_nodash;
719  const bool has_parkingbrake = actorx->GetActor()->getTruckType() != NOT_DRIVEABLE && actorx->GetActor()->getTruckType() != BOAT;
720  if (num_axlediffs || num_wheeldiffs || tc_visible || alb_visible || has_parkingbrake || has_engine)
721  {
722  ImGui::TextDisabled("Traction:");
723  if (num_axlediffs)
724  {
725  this->DrawAxleDiffButton(actorx);
726  }
727  if (num_wheeldiffs)
728  {
729  this->DrawWheelDiffButton(actorx);
730  }
731  if (tc_visible)
732  {
733  this->DrawTractionControlButton(actorx);
734  }
735  if (alb_visible)
736  {
737  this->DrawAntiLockBrakeButton(actorx);
738  }
739  if (has_parkingbrake)
740  {
741  this->DrawParkingBrakeButton(actorx);
742  }
743  if (has_engine)
744  {
745  this->DrawCruiseControlButton(actorx);
746  }
747  }
748 
749  const size_t num_locks = actorx->GetActor()->ar_hooks.size();
750  const size_t num_ties = actorx->GetActor()->ar_ties.size();
751  if (num_locks || num_ties)
752  {
753  ImGui::TextDisabled("Connections:");
754  if (num_locks)
755  {
756  this->DrawLockButton(actorx);
757  }
758  if (num_ties)
759  {
760  this->DrawSecureButton(actorx);
761  }
762  }
763 
764  const int num_cparticles = actorx->GetActor()->ar_num_custom_particles;
765  const size_t num_videocams = actorx->getNumVideoCameras();
766  ImGui::TextDisabled("View:");
767  if (num_cparticles)
768  {
769  this->DrawParticlesButton(actorx);
770  }
771  if (num_videocams)
772  {
773  this->DrawMirrorButton(actorx);
774  }
775 
776  this->DrawCameraButton();
777 }
778 
780 {
782  {
783  return;
784  }
785 
786  ImDrawList* draw_list = GetImDummyFullscreenWindow("RoR_VehicleCommandHighlights");
787  for (const commandbeam_t& cmdbeam: actorx->GetActor()->ar_command_key[m_hovered_commandkey].beams)
788  {
789  const beam_t& beam = actorx->GetActor()->ar_beams[cmdbeam.cmb_beam_index];
790  ImVec2 p1_pos, p2_pos;
791  if (GetScreenPosFromWorldPos(beam.p1->AbsPosition, p1_pos) && GetScreenPosFromWorldPos(beam.p2->AbsPosition, p2_pos))
792  {
793  draw_list->AddLine(p1_pos, p2_pos, ImColor(m_cmdbeam_highlight_color), m_cmdbeam_highlight_thickness);
794  }
795  }
796 }
797 
798 bool DrawSingleButtonRow(bool active, const Ogre::TexturePtr& icon, const char* name, RoR::events ev, bool* btn_active = nullptr)
799 {
800  if (active)
801  {
802  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
803  }
804  else
805  {
806  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
807  }
808 
809  ImGui::GetWindowDrawList()->AddRectFilled(
810  ImGui::GetCursorScreenPos() - BUTTON_OFFSET, ImGui::GetCursorScreenPos() + BUTTON_SIZE,
811  ImColor(ImGui::GetStyle().Colors[ImGuiCol_Button]), ImGui::GetStyle().FrameRounding);
812  ImGui::GetWindowDrawList()->AddImage(reinterpret_cast<ImTextureID>(icon->getHandle()),
813  ImGui::GetCursorScreenPos() - BUTTON_OFFSET, ImGui::GetCursorScreenPos() + BUTTON_SIZE);
814  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + BUTTON_SIZE.x + 2*ImGui::GetStyle().ItemSpacing.x);
815  ImGui::PopStyleColor();
816 
817  ImGui::Text("%s", name);
818  ImGui::SameLine();
819  const ImVec2 btn_size = ImCalcEventHighlightedSize(ev);
820  ImGui::SetCursorPosX(ImGui::GetWindowContentRegionMax().x - btn_size.x);
821  return ImDrawEventHighlightedButton(ev, nullptr, btn_active);
822 }
823 
825 {
827  {
828  actorx->GetActor()->toggleHeadlights();
829  }
830 }
831 
833 {
835  {
836  actorx->GetActor()->toggleBlinkType(BLINK_LEFT);
837  }
838 }
839 
841 {
843  {
845  }
846 }
847 
849 {
851  {
852  actorx->GetActor()->toggleBlinkType(BLINK_WARN);
853  }
854 }
855 
857 {
858  if (actorx->GetActor()->ar_is_police) // Police siren
859  {
861  {
862  SOUND_TOGGLE(actorx->GetActor(), SS_TRIG_HORN);
863  }
864  }
865  else
866  {
867  // Triggering continuous command every frame is sloppy
868  // Set state and read it in GameContext via GetHornButtonState()
870  }
871 }
872 
874 {
876  {
878  {
880  }
881  else
882  {
884  }
885  }
886 }
887 
889 {
891  {
893  rq->amr_actor = actorx->GetActor()->ar_instance_id;
896  }
897 }
898 
900 {
902  {
903  actorx->GetActor()->parkingbrakeToggle();
904  }
905 }
906 
908 {
910  {
911  actorx->GetActor()->tractioncontrolToggle();
912  }
913 }
914 
916 {
918  {
919  actorx->GetActor()->antilockbrakeToggle();
920  }
921 }
922 
924 {
926  {
927  actorx->GetActor()->ar_physics_paused = !actorx->GetActor()->ar_physics_paused;
928  }
929 }
930 
932 {
934  {
935  actorx->GetActor()->toggleAxleDiffMode();
936  actorx->GetActor()->displayAxleDiffMode();
937  }
938 }
939 
941 {
943  {
944  actorx->GetActor()->toggleWheelDiffMode();
945  actorx->GetActor()->displayWheelDiffMode();
946  }
947 }
948 
950 {
952  {
953  actorx->GetActor()->toggleTransferCaseMode();
954  actorx->GetActor()->displayTransferCaseMode();
955  }
956 }
957 
959 {
961  {
963  actorx->GetActor()->displayTransferCaseMode();
964  }
965 }
966 
968 {
970  {
971  actorx->GetActor()->toggleCustomParticles();
972  }
973 }
974 
976 {
978  {
979  actorx->GetActor()->beaconsToggle();
980  }
981 }
982 
984 {
986  {
987  actorx->GetActor()->ar_engine->ToggleAutoShiftMode();
988  // force gui update
989  actorx->GetActor()->RequestUpdateHudFeatures();
990 
991  // Inform player via chatbox
992  const char* msg = nullptr;
993  switch (actorx->GetActor()->ar_engine->GetAutoShiftMode())
994  {
995  case SimGearboxMode::AUTO: msg = "Automatic shift";
996  break;
997  case SimGearboxMode::SEMI_AUTO: msg = "Manual shift - Auto clutch";
998  break;
999  case SimGearboxMode::MANUAL: msg = "Fully Manual: sequential shift";
1000  break;
1001  case SimGearboxMode::MANUAL_STICK: msg = "Fully manual: stick shift";
1002  break;
1003  case SimGearboxMode::MANUAL_RANGES: msg = "Fully Manual: stick shift with ranges";
1004  break;
1005  }
1007  }
1008 }
1009 
1011 {
1013  {
1014  if (actorx->GetActor()->ar_engine && actorx->GetActor()->ar_engine->isRunning())
1015  {
1016  actorx->GetActor()->ar_engine->toggleContact();
1017  }
1018  else if (actorx->GetActor()->ar_engine)
1019  {
1020  actorx->GetActor()->ar_engine->StartEngine();
1021  }
1022  }
1023 }
1024 
1026 {
1027  int num_custom_flares = 0;
1028 
1029  for (int i = 0; i < MAX_CLIGHTS; i++)
1030  {
1031  if (actorx->GetActor()->countCustomLights(i) > 0)
1032  {
1033  ImGui::PushID(i);
1034  num_custom_flares++;
1035 
1036  if (i == 5 || i == 9) // Add new line every 4 buttons
1037  {
1038  ImGui::NewLine();
1039  }
1040 
1041  std::string label = "L" + std::to_string(i + 1);
1042 
1043  if (actorx->GetActor()->getCustomLightVisible(i))
1044  {
1045  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1046  }
1047  else
1048  {
1049  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1050  }
1051 
1052  if (ImGui::Button(label.c_str(), ImVec2(32, 0)))
1053  {
1054  actorx->GetActor()->setCustomLightVisible(i, !actorx->GetActor()->getCustomLightVisible(i));
1055  }
1056  if (ImGui::IsItemHovered())
1057  {
1058  ImGui::BeginTooltip();
1059  ImGui::TextDisabled("%s %d (%s)", "Custom Light", i + 1, App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_LIGHTTOGGLE01 + i).c_str());
1060  ImGui::EndTooltip();
1061  }
1062  ImGui::SameLine();
1063 
1064  ImGui::PopStyleColor();
1065  ImGui::PopID();
1066  }
1067  }
1068  if (num_custom_flares > 0)
1069  {
1070  ImGui::NewLine();
1071  }
1072 }
1073 
1074 
1075 
1077 {
1078  if (DrawSingleButtonRow(false, m_camera_icon, "Switch Camera", EV_CAMERA_CHANGE))
1079  {
1080  if (App::GetCameraManager()->EvaluateSwitchBehavior())
1081  {
1083  }
1084  }
1085 }
1086 
1088 {
1089  if (DrawSingleButtonRow(actorx->GetActor()->isLocked(), m_lock_icon, "Lock", EV_COMMON_LOCK))
1090  {
1091  //actorx->GetActor()->hookToggle(-1, HOOK_TOGGLE, -1);
1092  ActorLinkingRequest* hook_rq = new ActorLinkingRequest();
1094  hook_rq->alr_actor_instance_id = actorx->GetActor()->ar_instance_id;
1096 
1097  //actorx->GetActor()->toggleSlideNodeLock();
1098  ActorLinkingRequest* slidenode_rq = new ActorLinkingRequest();
1100  slidenode_rq->alr_actor_instance_id = actorx->GetActor()->ar_instance_id;
1102  }
1103 }
1104 
1106 {
1108  {
1109  //actorx->GetActor()->tieToggle(-1, TIE_TOGGLE, -1);
1110  ActorLinkingRequest* tie_rq = new ActorLinkingRequest();
1112  tie_rq->alr_actor_instance_id = actorx->GetActor()->ar_instance_id;
1114  }
1115 }
1116 
1118 {
1120  {
1121  actorx->GetActor()->cruisecontrolToggle();
1122  }
1123 }
1124 
1126 {
1127  // Icons used https://materialdesignicons.com/
1128  // Licence https://github.com/Templarian/MaterialDesign/blob/master/LICENSE
1129 
1130  m_headlight_icon = FetchIcon("car-light-high.png");
1131  m_left_blinker_icon = FetchIcon("arrow-left-bold.png");
1132  m_right_blinker_icon = FetchIcon("arrow-right-bold.png");
1133  m_warning_light_icon = FetchIcon("hazard-lights.png");
1134  m_horn_icon = FetchIcon("bugle.png");
1135  m_mirror_icon = FetchIcon("mirror-rectangle.png");
1136  m_repair_icon = FetchIcon("car-wrench.png");
1137  m_parking_brake_icon = FetchIcon("car-brake-alert.png");
1138  m_traction_control_icon = FetchIcon("car-traction-control.png");
1139  m_abs_icon = FetchIcon("car-brake-abs.png");
1140  m_physics_icon = FetchIcon("pause.png");
1141  m_actor_physics_icon = FetchIcon("pause-circle-outline.png");
1142  m_a_icon = FetchIcon("alpha-a-circle.png");
1143  m_w_icon = FetchIcon("alpha-w-circle.png");
1144  m_m_icon = FetchIcon("alpha-m-circle.png");
1145  m_g_icon = FetchIcon("alpha-g-circle.png");
1146  m_particle_icon = FetchIcon("water.png");
1147  m_shift_icon = FetchIcon("car-shift-pattern.png");
1148  m_engine_icon = FetchIcon("engine.png");
1149  m_beacons_icon = FetchIcon("alarm-light-outline.png");
1150  m_camera_icon = FetchIcon("camera-switch-outline.png");
1151  m_lock_icon = FetchIcon("alpha-l-circle.png");
1152  m_secure_icon = FetchIcon("lock-outline.png");
1153  m_cruise_control_icon = FetchIcon("car-cruise-control.png");
1154 
1155  m_icons_cached = true;
1156 }
RoR::Actor::getAxleDiffMode
int getAxleDiffMode()
Writes info to console/notify box.
Definition: Actor.h:148
GameContext.h
Game state manager and message-queue provider.
RoR::GUI::VehicleInfoTPanel::m_m_icon
Ogre::TexturePtr m_m_icon
Definition: GUI_VehicleInfoTPanel.h:141
RoR::TransferCase::tr_ax_2
int tr_ax_2
This axle is only driven in 4WD mode.
Definition: Differentials.h:50
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::GfxActor::SetDebugView
void SetDebugView(DebugViewType dv)
Definition: GfxActor.cpp:1528
RoR::GUI::VehicleInfoTPanel::DrawRepairButton
void DrawRepairButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:888
RoR::Actor::cc_mode
bool cc_mode
Cruise Control.
Definition: Actor.h:358
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::Actor::getWheelDiffMode
int getWheelDiffMode()
Writes info to console/notify box.
Definition: Actor.h:151
RoR::GUI::VehicleInfoTPanel::TPanelMode
TPanelMode
Definition: GUI_VehicleInfoTPanel.h:37
RoR::App::gfx_speedo_imperial
CVar * gfx_speedo_imperial
Definition: Application.cpp:246
RGN_CACHE
#define RGN_CACHE
Definition: Application.h:46
RoR::Actor::getBeaconMode
bool getBeaconMode() const
Definition: Actor.h:169
RoR::ImTextWrappedColorMarked
void ImTextWrappedColorMarked(std::string const &text)
Prints multiline text with '#rrggbb' color markers. Behaves like ImGui::Text* functions.
Definition: GUIUtils.cpp:246
RoR::GUI::VehicleInfoTPanel::m_a_icon
Ogre::TexturePtr m_a_icon
Definition: GUI_VehicleInfoTPanel.h:139
RoR::EngineSim::isRunning
bool isRunning() const
Definition: EngineSim.h:93
RoR::ActorSB::simbuf_driveable
int simbuf_driveable
Definition: SimBuffers.h:120
RoR::ImCalcEventHighlightedSize
ImVec2 ImCalcEventHighlightedSize(events input_event)
Definition: GUIUtils.cpp:467
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::GUIManager::GuiTheme::value_red_text_color
ImVec4 value_red_text_color
Definition: GUIManager.h:74
RoR::EV_TRUCK_SHIFT_UP
@ EV_TRUCK_SHIFT_UP
shift one gear up in manual transmission mode
Definition: InputEngine.h:355
RoR::Actor::hasSlidenodes
bool hasSlidenodes()
Definition: Actor.h:109
RoR::MSG_SIM_MODIFY_ACTOR_REQUESTED
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
Definition: Application.h:120
RoR::DebugViewType::DEBUGVIEW_BEAMS
@ DEBUGVIEW_BEAMS
DrawStatsLineColored
void DrawStatsLineColored(const char *name, const std::string &value, ImVec4 value_color)
Definition: GUI_VehicleInfoTPanel.cpp:335
RoR::FetchIcon
Ogre::TexturePtr FetchIcon(const char *name)
Definition: GUIUtils.cpp:344
RoR::GUI::VehicleInfoTPanel::m_physics_icon
Ogre::TexturePtr m_physics_icon
Definition: GUI_VehicleInfoTPanel.h:137
RoR::EV_COMMON_REPAIR_TRUCK
@ EV_COMMON_REPAIR_TRUCK
repair truck to original condition
Definition: InputEngine.h:250
RoR::GfxActor::getNumVideoCameras
size_t getNumVideoCameras() const
Definition: GfxActor.h:146
RoR::EV_TRUCK_TOGGLE_CONTACT
@ EV_TRUCK_TOGGLE_CONTACT
toggle ignition
Definition: InputEngine.h:360
RoR::Actor::ar_physics_paused
bool ar_physics_paused
Sim state.
Definition: Actor.h:478
RoR::Actor::isLocked
bool isLocked()
Are hooks locked?
Definition: Actor.cpp:3878
RoR::FlareType::BLINKER_LEFT
@ BLINKER_LEFT
RoR::TRUCK
@ TRUCK
its a truck (or other land vehicle)
Definition: SimData.h:93
RoR::GUI::VehicleInfoTPanel::m_icons_cached
bool m_icons_cached
Definition: GUI_VehicleInfoTPanel.h:126
RoR::EV_COMMON_TOGGLE_TRUCK_BEACONS
@ EV_COMMON_TOGGLE_TRUCK_BEACONS
toggle truck beacons
Definition: InputEngine.h:273
RoR::EV_TRUCK_BLINK_RIGHT
@ EV_TRUCK_BLINK_RIGHT
toggle right direction indicator (blinker)
Definition: InputEngine.h:304
RoR::GUI::VehicleInfoTPanel::DrawWarnBlinkerButton
void DrawWarnBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:848
RoR::Actor::toggleAxleDiffMode
void toggleAxleDiffMode()
Definition: Actor.cpp:1358
MAX_CLIGHTS
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
Definition: SimConstants.h:35
RoR::GUI::VehicleInfoTPanel::m_visibility_mode
TPanelMode m_visibility_mode
Definition: GUI_VehicleInfoTPanel.h:51
RoR::GUIManager::GuiTheme
Definition: GUIManager.h:68
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:275
RoR::node_t::AbsPosition
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
Definition: SimData.h:294
GUI_VehicleInfoTPanel.h
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:269
RoR::App::diag_hide_broken_beams
CVar * diag_hide_broken_beams
Definition: Application.cpp:152
RoR::GUIManager::GuiTheme::value_blue_text_color
ImVec4 value_blue_text_color
Definition: GUIManager.h:75
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::ActorLinkingRequest
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
Definition: SimData.h:917
RoR::beam_t::p1
node_t * p1
Definition: SimData.h:335
RoR::GfxActor::GetSimNodeBuffer
NodeSB * GetSimNodeBuffer()
Definition: GfxActor.h:120
RoR::GUI::VehicleInfoTPanel::TPANELMODE_HIDDEN
@ TPANELMODE_HIDDEN
Definition: GUI_VehicleInfoTPanel.h:37
RoR::EngineSim::ToggleAutoShiftMode
void ToggleAutoShiftMode()
Definition: EngineSim.cpp:818
RoR::Actor::getCustomParticleMode
bool getCustomParticleMode()
Definition: Actor.cpp:4551
RoR::DebugViewType::DEBUGVIEW_NONE
@ DEBUGVIEW_NONE
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:370
RoR::GUI::VehicleInfoTPanel::CacheIcons
void CacheIcons()
Definition: GUI_VehicleInfoTPanel.cpp:1125
RoR::Actor::ar_num_nodes
int ar_num_nodes
Definition: Actor.h:277
RoR::GetScreenPosFromWorldPos
bool GetScreenPosFromWorldPos(Ogre::Vector3 const &world_pos, ImVec2 &out_screen)
Definition: GUIUtils.cpp:518
MIN_PANEL_WIDTH
const float MIN_PANEL_WIDTH
Definition: GUI_VehicleInfoTPanel.cpp:41
RoR::GUI::VehicleInfoTPanel::m_helptext_fullsize
bool m_helptext_fullsize
Definition: GUI_VehicleInfoTPanel.h:72
RoR::Actor::ar_unique_commandkey_pairs
std::vector< UniqueCommandKeyPair > ar_unique_commandkey_pairs
UI helper for displaying command control keys to user (must be built at spawn).
Definition: Actor.h:313
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
BUTTONDUMMY_SIZE
const ImVec2 BUTTONDUMMY_SIZE(18, 1)
RoR::Actor::toggleWheelDiffMode
void toggleWheelDiffMode()
Definition: Actor.cpp:1350
format
Truck file format(technical spec)
RoR::ActorSB::simbuf_screwprops
std::vector< ScrewpropSB > simbuf_screwprops
Definition: SimBuffers.h:135
RoR::GUI::VehicleInfoTPanel::m_w_icon
Ogre::TexturePtr m_w_icon
Definition: GUI_VehicleInfoTPanel.h:140
GUIUtils.h
RoR::TransferCase::tr_2wd
bool tr_2wd
Does it support 2WD mode?
Definition: Differentials.h:51
RoR::Actor::getWheelNodeCount
int getWheelNodeCount() const
Definition: Actor.cpp:869
RoR::GfxActor::GetActor
ActorPtr GetActor()
Definition: GfxActor.cpp:288
RoR::DebugViewType::DEBUGVIEW_ROTATORS
@ DEBUGVIEW_ROTATORS
RoR::EV_TRUCK_BLINK_WARN
@ EV_TRUCK_BLINK_WARN
toggle all direction indicators
Definition: InputEngine.h:305
RoR::GUI::VehicleInfoTPanel::m_warning_light_icon
Ogre::TexturePtr m_warning_light_icon
Definition: GUI_VehicleInfoTPanel.h:130
RoR::GfxActor::countBeaconProps
int countBeaconProps() const
Definition: GfxActor.cpp:3337
RoR::GUI::VehicleInfoTPanel::DrawActorPhysicsButton
void DrawActorPhysicsButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:923
RoR::ScrewpropSB
Definition: SimBuffers.h:74
RoR::DebugViewType
DebugViewType
Definition: GfxData.h:101
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::ActorLinkingRequest::alr_type
ActorLinkingRequestType alr_type
Definition: SimData.h:920
RoR::Actor::ar_engine
EngineSim * ar_engine
Definition: Actor.h:373
RoR::AeroEngineSB
Definition: SimBuffers.h:90
RoR::GUI::VehicleInfoTPanel::m_stat_broken_beams
int m_stat_broken_beams
Definition: GUI_VehicleInfoTPanel.h:79
RoR::ActorSB::simbuf_node0_velo
Ogre::Vector3 simbuf_node0_velo
Definition: SimBuffers.h:124
RoR::Round
Ogre::Real Round(Ogre::Real value, unsigned short ndigits=0)
Definition: Utils.cpp:98
RoR::EV_TRUCK_CRUISE_CONTROL
@ EV_TRUCK_CRUISE_CONTROL
toggle cruise control
Definition: InputEngine.h:309
RoR::Actor::RequestUpdateHudFeatures
void RequestUpdateHudFeatures()
Definition: Actor.h:264
RoR::ActorLinkingRequestType::HOOK_TOGGLE
@ HOOK_TOGGLE
RoR::Actor::getDescription
std::vector< std::string > getDescription()
Definition: Actor.cpp:4463
RoR::Actor::toggleCustomParticles
void toggleCustomParticles()
Definition: Actor.cpp:3174
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::Actor::ar_num_rotators
int ar_num_rotators
Definition: Actor.h:288
RoR::GUI::VehicleInfoTPanel::m_horn_btn_active
bool m_horn_btn_active
Definition: GUI_VehicleInfoTPanel.h:125
RoR::FlareType::HEADLIGHT
@ HEADLIGHT
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:97
RoR::Actor::ar_hooks
std::vector< hook_t > ar_hooks
Definition: Actor.h:296
RoR::FlareType::BLINKER_RIGHT
@ BLINKER_RIGHT
RoR::ActorSB::simbuf_aeroengines
std::vector< AeroEngineSB > simbuf_aeroengines
Definition: SimBuffers.h:138
RoR::EV_TRUCK_TRACTION_CONTROL
@ EV_TRUCK_TRACTION_CONTROL
toggle antilockbrake system
Definition: InputEngine.h:369
RoR::GUI::VehicleInfoTPanel::m_beacons_icon
Ogre::TexturePtr m_beacons_icon
Definition: GUI_VehicleInfoTPanel.h:146
RoR::Actor::ar_ties
std::vector< tie_t > ar_ties
Definition: Actor.h:295
RoR::DebugViewType::DEBUGVIEW_SUBMESH
@ DEBUGVIEW_SUBMESH
RoR::EV_TRUCK_SHIFT_DOWN
@ EV_TRUCK_SHIFT_DOWN
shift one gear down in manual transmission mode
Definition: InputEngine.h:331
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::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:263
RoR::Actor::ar_num_cabs
int ar_num_cabs
Definition: Actor.h:328
RoR::GUI::VehicleInfoTPanel::m_active_commandkey
CommandkeyID_t m_active_commandkey
Definition: GUI_VehicleInfoTPanel.h:65
RoR::TransferCase::tr_gear_ratios
std::vector< float > tr_gear_ratios
Gear reduction ratios.
Definition: Differentials.h:54
RoR::GUI::VehicleInfoTPanel::DrawRightBlinkerButton
void DrawRightBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:840
RoR::App::diag_hide_beam_stress
CVar * diag_hide_beam_stress
Definition: Application.cpp:153
RoR::GUI::VehicleInfoTPanel::m_requested_focus
TPanelFocus m_requested_focus
Requested by SetVisible()
Definition: GUI_VehicleInfoTPanel.h:52
Utils.h
RoR::NOT_DRIVEABLE
@ NOT_DRIVEABLE
not drivable at all
Definition: SimData.h:92
RoR::FlareType::TAIL_LIGHT
@ TAIL_LIGHT
Language.h
RoR::Actor::displayAxleDiffMode
void displayAxleDiffMode()
Cycles through the available inter axle diff modes.
Definition: Actor.cpp:1366
RoR::GUIManager::GuiTheme::semitransparent_window_bg
ImVec4 semitransparent_window_bg
Definition: GUIManager.h:81
RoR::Actor::tractioncontrolToggle
void tractioncontrolToggle()
Definition: Actor.cpp:3786
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
DrawStatsLine
void DrawStatsLine(const char *name, const std::string &value)
Definition: GUI_VehicleInfoTPanel.cpp:351
RefCountingObjectPtr< Actor >
RoR::GUI::VehicleInfoTPanel::m_stat_beam_stress
float m_stat_beam_stress
Definition: GUI_VehicleInfoTPanel.h:81
RoR::Actor::beaconsToggle
void beaconsToggle()
Definition: Actor.cpp:3795
GUIManager.h
RoR::GfxActor::SetVideoCamState
void SetVideoCamState(VideoCamState state)
Definition: GfxActor.cpp:394
Actor.h
RoR::GUI::VehicleInfoTPanel::DrawTransferCaseModeButton
void DrawTransferCaseModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:949
RoR::beam_t::stress
float stress
Definition: SimData.h:344
RoR::App::diag_hide_wheel_info
CVar * diag_hide_wheel_info
Definition: Application.cpp:154
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_DIAG
@ TPANELFOCUS_DIAG
Definition: GUI_VehicleInfoTPanel.h:38
RoR::Actor::tc_nodash
bool tc_nodash
Traction control attribute; Hide the dashboard indicator?
Definition: Actor.h:354
RoR::Console::CONSOLE_SYSTEM_NOTICE
@ CONSOLE_SYSTEM_NOTICE
Definition: Console.h:51
EngineSim.h
RoR::GUI::VehicleInfoTPanel::m_startupdemo_init
bool m_startupdemo_init
Definition: GUI_VehicleInfoTPanel.h:55
RoR::SimGearboxMode::AUTO
@ AUTO
Automatic shift.
RoR::beam_t::refL
float refL
reference length
Definition: SimData.h:356
RoR::GUI::VehicleInfoTPanel::DrawWheelDiffButton
void DrawWheelDiffButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:940
DrawStatsBullet
void DrawStatsBullet(const char *name, const std::string &value)
Definition: GUI_VehicleInfoTPanel.cpp:356
RoR::Actor::getMaxGForces
Ogre::Vector3 getMaxGForces()
Definition: Actor.h:108
RoR::GUI::VehicleInfoTPanel::m_stat_gmax_y
float m_stat_gmax_y
Definition: GUI_VehicleInfoTPanel.h:88
RoR::GetImDummyFullscreenWindow
ImDrawList * GetImDummyFullscreenWindow(const std::string &name="RoR_TransparentFullscreenWindow")
Definition: GUIUtils.cpp:356
RoR::ActorModifyRequest::amr_actor
ActorInstanceID_t amr_actor
Definition: SimData.h:886
RoR::SimGearboxMode::MANUAL_STICK
@ MANUAL_STICK
Fully manual: stick shift.
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::GfxActor::GetVideoCamState
VideoCamState GetVideoCamState() const
Definition: GfxActor.h:137
RoR::GUIManager::GetTheme
GuiTheme & GetTheme()
Definition: GUIManager.h:154
RoR::DebugViewType::DEBUGVIEW_SLIDENODES
@ DEBUGVIEW_SLIDENODES
RoR::beam_t
Simulation: An edge in the softbody structure.
Definition: SimData.h:330
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::Actor::ar_beams
beam_t * ar_beams
Definition: Actor.h:281
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
SimData.h
Core data structures for simulation; Everything affected by by either physics, network or user intera...
RoR::ActorModifyRequest
Definition: SimData.h:870
RoR::CacheEntry::filecachename
Ogre::String filecachename
preview image filename
Definition: CacheSystem.h:87
RoR::EV_TRUCK_STARTER
@ EV_TRUCK_STARTER
hold to start the engine
Definition: InputEngine.h:356
RoR::EV_TRUCK_LIGHTTOGGLE01
@ EV_TRUCK_LIGHTTOGGLE01
toggle custom light 1
Definition: InputEngine.h:316
RoR::Actor::toggleHeadlights
void toggleHeadlights()
Definition: Actor.cpp:2989
RoR::GfxActor::GetHelpTex
Ogre::TexturePtr GetHelpTex()
Definition: GfxActor.h:141
RoR::Actor::getTransferCaseMode
TransferCase * getTransferCaseMode()
Toggles between 2WD and 4WD mode.
Definition: Actor.h:153
RoR::ActorSB::simbuf_drive_ratio
float simbuf_drive_ratio
Definition: SimBuffers.h:153
RoR::Actor::ar_num_custom_particles
int ar_num_custom_particles
Definition: Actor.h:320
RoR::App::diag_hide_wheels
CVar * diag_hide_wheels
Definition: Application.cpp:155
RoR::GUI::VehicleInfoTPanel::m_cmdbeam_highlight_thickness
float m_cmdbeam_highlight_thickness
Definition: GUI_VehicleInfoTPanel.h:70
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:65
DrawSingleBulletRow
void DrawSingleBulletRow(const char *name, RoR::events ev)
Definition: GUI_VehicleInfoTPanel.cpp:608
RoR::ActorSB::simbuf_inputshaft_rpm
float simbuf_inputshaft_rpm
Definition: SimBuffers.h:152
RoR::GUI::VehicleInfoTPanel::DrawVehicleDiagUI
void DrawVehicleDiagUI(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:499
HELP_TEXTURE_WIDTH
const float HELP_TEXTURE_WIDTH
Definition: GUI_VehicleInfoTPanel.cpp:38
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::Actor::antilockbrakeToggle
void antilockbrakeToggle()
Definition: Actor.cpp:3777
RoR::Actor::getHeadlightsVisible
bool getHeadlightsVisible() const
Definition: Actor.h:181
RoR::EngineSim::GetAutoShiftMode
RoR::SimGearboxMode GetAutoShiftMode()
Definition: EngineSim.cpp:842
RoR::Actor::ar_command_key
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Definition: Actor.h:299
RoR::EV_TRUCK_TOGGLE_TCASE_4WD_MODE
@ EV_TRUCK_TOGGLE_TCASE_4WD_MODE
toggle the transfer case 4wd mode
Definition: InputEngine.h:366
RoR::GUI::VehicleInfoTPanel::DrawParticlesButton
void DrawParticlesButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:967
RoR::EV_TRUCK_TOGGLE_VIDEOCAMERA
@ EV_TRUCK_TOGGLE_VIDEOCAMERA
toggle videocamera update
Definition: InputEngine.h:368
RoR::BLINK_RIGHT
@ BLINK_RIGHT
Definition: SimData.h:125
RoR::BLINK_WARN
@ BLINK_WARN
Definition: SimData.h:126
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_STATS
@ TPANELFOCUS_STATS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUI::VehicleInfoTPanel::DrawCameraButton
void DrawCameraButton()
Definition: GUI_VehicleInfoTPanel.cpp:1076
BUTTON_SIZE
const ImVec2 BUTTON_SIZE(18, 18)
RoR::GUI::VehicleInfoTPanel::m_transluc_textdis_color
ImVec4 m_transluc_textdis_color
Definition: GUI_VehicleInfoTPanel.h:57
RoR::ActorSB::simbuf_wheel_speed
float simbuf_wheel_speed
Definition: SimBuffers.h:127
RoR::GUI::VehicleInfoTPanel::m_stat_avg_deform
float m_stat_avg_deform
Definition: GUI_VehicleInfoTPanel.h:83
Application.h
Central state/object manager and communications hub.
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:270
RoR::EV_COMMON_LOCK
@ EV_COMMON_LOCK
connect hook node to a node in close proximity
Definition: InputEngine.h:240
RoR::SimGearboxMode::SEMI_AUTO
@ SEMI_AUTO
Manual shift with auto clutch.
RoR::GUI::VehicleInfoTPanel::m_current_focus
TPanelFocus m_current_focus
Updated based on currently open tab.
Definition: GUI_VehicleInfoTPanel.h:53
BUTTON_OFFSET
const ImVec2 BUTTON_OFFSET(0, 3.f)
RoR::Actor::isTied
bool isTied()
Definition: Actor.cpp:3870
RoR::ImDrawEventHighlightedButton
bool ImDrawEventHighlightedButton(events input_event, bool *btn_hovered=nullptr, bool *btn_active=nullptr)
Definition: GUIUtils.cpp:424
RoR::EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
@ EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
toggle the inter wheel differential mode
Definition: InputEngine.h:364
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RoR::GUI::VehicleInfoTPanel::m_engine_icon
Ogre::TexturePtr m_engine_icon
Definition: GUI_VehicleInfoTPanel.h:145
HELP_TEXTURE_HEIGHT
const float HELP_TEXTURE_HEIGHT
Definition: GUI_VehicleInfoTPanel.cpp:39
RoR::InputEngine::resolveEventName
static int resolveEventName(Ogre::String eventName)
Definition: InputEngine.cpp:2000
RoR::AIRPLANE
@ AIRPLANE
its an airplane
Definition: SimData.h:94
RoR::GUI::VehicleInfoTPanel::m_camera_icon
Ogre::TexturePtr m_camera_icon
Definition: GUI_VehicleInfoTPanel.h:147
RoR::EV_TRUCK_HORN
@ EV_TRUCK_HORN
truck horn
Definition: InputEngine.h:313
RoR::EV_COMMON_SECURE_LOAD
@ EV_COMMON_SECURE_LOAD
tie a load to the truck
Definition: InputEngine.h:263
RoR::ActorSB::simbuf_engine_rpm
float simbuf_engine_rpm
Definition: SimBuffers.h:147
FormatVelocityBySpeedoPreset
std::string FormatVelocityBySpeedoPreset(float velocity)
Definition: GUI_VehicleInfoTPanel.cpp:366
RoR::BLINK_LEFT
@ BLINK_LEFT
Definition: SimData.h:124
RoR::GUI::VehicleInfoTPanel::m_cruise_control_icon
Ogre::TexturePtr m_cruise_control_icon
Definition: GUI_VehicleInfoTPanel.h:150
RoR::beam_t::bm_type
BeamType bm_type
Definition: SimData.h:348
RoR::EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
@ EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
toggle truck low beams (on/off); also toggles running lights.
Definition: InputEngine.h:275
RoR::VideoCamState::VCSTATE_DISABLED
@ VCSTATE_DISABLED
RoR::GUI::VehicleInfoTPanel::DrawParkingBrakeButton
void DrawParkingBrakeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:899
RoR::Actor::ar_num_beams
int ar_num_beams
Definition: Actor.h:282
RoR::GUI::VehicleInfoTPanel::DrawCustomLightButton
void DrawCustomLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:1025
RoR::DebugViewType::DEBUGVIEW_SHOCKS
@ DEBUGVIEW_SHOCKS
RoR::Actor::getTotalMass
float getTotalMass(bool withLocked=true)
Definition: Actor.cpp:810
RoR::GUI::VehicleInfoTPanel::m_shift_icon
Ogre::TexturePtr m_shift_icon
Definition: GUI_VehicleInfoTPanel.h:144
RoR::Actor::getUsedActorEntry
CacheEntryPtr & getUsedActorEntry()
The actor entry itself.
Definition: Actor.cpp:4709
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::Actor::tc_mode
bool tc_mode
Traction control state; Enabled? {1/0}.
Definition: Actor.h:351
RoR::GUI::VehicleInfoTPanel::DrawTransferCaseGearRatioButton
void DrawTransferCaseGearRatioButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:958
RoR::SS_TRIG_HORN
@ SS_TRIG_HORN
Definition: SoundScriptManager.h:59
RoR::EV_TRUCK_SWITCH_SHIFT_MODES
@ EV_TRUCK_SWITCH_SHIFT_MODES
toggle between transmission modes
Definition: InputEngine.h:359
RoR::SimGearboxMode::MANUAL
@ MANUAL
Fully manual: sequential shift.
RoR::NodeSB::AbsPosition
Ogre::Vector3 AbsPosition
Definition: SimBuffers.h:69
RoR::Actor::toggleTransferCaseMode
void toggleTransferCaseMode()
Definition: Actor.cpp:1434
RoR::Actor::parkingbrakeToggle
void parkingbrakeToggle()
Definition: Actor.cpp:3762
RoR::GUIManager::GuiTheme::screen_edge_padding
ImVec2 screen_edge_padding
Definition: GUIManager.h:85
RoR::ActorSB::simbuf_top_speed
float simbuf_top_speed
Definition: SimBuffers.h:128
RoR::Actor::getParkingBrake
bool getParkingBrake()
Definition: Actor.h:144
RoR::Actor::ar_is_police
bool ar_is_police
Gfx/sfx attr.
Definition: Actor.h:472
RoR::GUI::VehicleInfoTPanel::m_startupdemo_timer
Ogre::Timer m_startupdemo_timer
Definition: GUI_VehicleInfoTPanel.h:54
RoR::Actor::alb_mode
bool alb_mode
Anti-lock brake state; Enabled? {1/0}.
Definition: Actor.h:344
RoR::EngineSim::toggleContact
void toggleContact()
Definition: EngineSim.cpp:985
RoR::EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
@ EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
toggle the transfer case gear ratio
Definition: InputEngine.h:367
RoR::App::ui_show_vehicle_buttons
CVar * ui_show_vehicle_buttons
Definition: Application.cpp:263
RoR::DebugViewType::DEBUGVIEW_NODES
@ DEBUGVIEW_NODES
RoR::EV_TRUCK_MANUAL_CLUTCH
@ EV_TRUCK_MANUAL_CLUTCH
manual clutch (for manual transmission)
Definition: InputEngine.h:326
RoR::UniqueCommandKeyPair
UI helper for displaying command control keys to user.
Definition: SimData.h:695
RoR::ActorSB::simbuf_engine_max_rpm
float simbuf_engine_max_rpm
Definition: SimBuffers.h:157
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::EV_CAMERA_CHANGE
@ EV_CAMERA_CHANGE
change camera mode
Definition: InputEngine.h:114
RoR::VideoCamState::VCSTATE_ENABLED_ONLINE
@ VCSTATE_ENABLED_ONLINE
RoR::Actor::toggleBlinkType
void toggleBlinkType(BlinkType blink)
Definition: Actor.cpp:3080
RoR::BEAM_HYDRO
@ BEAM_HYDRO
Definition: SimData.h:72
RoR::GUI::VehicleInfoTPanel::DrawTractionControlButton
void DrawTractionControlButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:907
RoR::DebugViewType::DEBUGVIEW_SKELETON
@ DEBUGVIEW_SKELETON
RoR::MSG_SIM_ACTOR_LINKING_REQUESTED
@ MSG_SIM_ACTOR_LINKING_REQUESTED
Payload = RoR::ActorLinkingRequest* (owner)
Definition: Application.h:128
RoR::ActorSB::simbuf_gear
int simbuf_gear
Definition: SimBuffers.h:145
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
_L
#define _L
Definition: ErrorUtils.cpp:34
RoR::GUI::VehicleInfoTPanel::DrawShiftModeButton
void DrawShiftModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:983
RoR::DebugViewType::DEBUGVIEW_WHEELS
@ DEBUGVIEW_WHEELS
RoR::Actor::alb_nodash
bool alb_nodash
Anti-lock brake attribute: Hide the dashboard indicator?
Definition: Actor.h:347
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::commandbeam_t
Definition: SimData.h:554
RoR::EngineSim::StartEngine
void StartEngine()
Quick engine start. Plays sounds.
Definition: EngineSim.cpp:998
RoR::EV_TRUCK_TOGGLE_PHYSICS
@ EV_TRUCK_TOGGLE_PHYSICS
toggle physics simulation
Definition: InputEngine.h:365
RoR::EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
@ EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
toggle the inter axle differential mode
Definition: InputEngine.h:363
RoR::Actor::toggleTransferCaseGearRatio
void toggleTransferCaseGearRatio()
Definition: Actor.cpp:1465
RoR::GUI::VehicleInfoTPanel::m_stat_gcur_y
float m_stat_gcur_y
Definition: GUI_VehicleInfoTPanel.h:85
RoR::Actor::ar_num_wheels
int ar_num_wheels
Definition: Actor.h:318
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:271
RoR::Actor::getTruckType
int getTruckType()
Definition: Actor.h:223
RoR::ActorLinkingRequest::alr_actor_instance_id
ActorInstanceID_t alr_actor_instance_id
Definition: SimData.h:919
RoR::ActorSB::simbuf_engine_turbo_psi
float simbuf_engine_turbo_psi
Definition: SimBuffers.h:149
RoR::GUI::VehicleInfoTPanel::m_mirror_icon
Ogre::TexturePtr m_mirror_icon
Definition: GUI_VehicleInfoTPanel.h:132
RoR::Actor::setCustomLightVisible
void setCustomLightVisible(int number, bool visible)
Definition: Actor.cpp:4495
RoR::beam_t::p2
node_t * p2
Definition: SimData.h:336
RoR::AeroEngineType::AE_XPROP
@ AE_XPROP
RoR::App::diag_hide_nodes
CVar * diag_hide_nodes
Definition: Application.cpp:156
RoR::EV_COMMON_TOGGLE_CUSTOM_PARTICLES
@ EV_COMMON_TOGGLE_CUSTOM_PARTICLES
toggle particle cannon
Definition: InputEngine.h:268
MAX_PREVIEW_SIZE
const ImVec2 MAX_PREVIEW_SIZE(100.f, 100.f)
RoR::EV_TRUCK_BLINK_LEFT
@ EV_TRUCK_BLINK_LEFT
toggle left direction indicator (blinker)
Definition: InputEngine.h:303
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::EV_TRUCK_AUTOSHIFT_UP
@ EV_TRUCK_AUTOSHIFT_UP
shift automatic transmission one gear up
Definition: InputEngine.h:302
RoR::SimGearboxMode::MANUAL_RANGES
@ MANUAL_RANGES
Fully manual: stick shift with ranges.
GfxActor.h
Manager for all visuals belonging to a single actor.
RoR::GUI::VehicleInfoTPanel::m_lock_icon
Ogre::TexturePtr m_lock_icon
Definition: GUI_VehicleInfoTPanel.h:148
RoR::Actor::countFlaresByType
int countFlaresByType(FlareType type)
Definition: Actor.cpp:4532
RoR::GUI::VehicleInfoTPanel::m_repair_icon
Ogre::TexturePtr m_repair_icon
Definition: GUI_VehicleInfoTPanel.h:133
RoR::Actor::countCustomLights
int countCustomLights(int control_number)
Definition: Actor.cpp:4515
RoR::ActorLinkingRequestType::SLIDENODE_TOGGLE
@ SLIDENODE_TOGGLE
RoR::DrawGCheckbox
bool DrawGCheckbox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:261
RoR::GUI::VehicleInfoTPanel::m_secure_icon
Ogre::TexturePtr m_secure_icon
Definition: GUI_VehicleInfoTPanel.h:149
RoR::GfxActor::GetDebugView
DebugViewType GetDebugView() const
Definition: GfxActor.h:138
RoR::ImDrawEventHighlighted
void ImDrawEventHighlighted(events input_event)
Definition: GUIUtils.cpp:408
RoR::Console::CONSOLE_MSGTYPE_INFO
@ CONSOLE_MSGTYPE_INFO
Generic message.
Definition: Console.h:60
RoR::EV_TRUCK_AUTOSHIFT_DOWN
@ EV_TRUCK_AUTOSHIFT_DOWN
shift automatic transmission one gear down
Definition: InputEngine.h:301
RoR::Actor::getBlinkType
BlinkType getBlinkType()
Definition: Actor.cpp:4543
RoR::Actor::getTruckName
std::string getTruckName()
Definition: Actor.h:220
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::events
events
Definition: InputEngine.h:74
RoR::BOAT
@ BOAT
its a boat
Definition: SimData.h:95
RoR::EV_COMMON_CYCLE_DEBUG_VIEWS
@ EV_COMMON_CYCLE_DEBUG_VIEWS
cycle debug view mode
Definition: InputEngine.h:266
RoR::Actor::getGForces
Ogre::Vector3 getGForces()
Definition: Actor.h:86
RoR::Actor::displayWheelDiffMode
void displayWheelDiffMode()
Cycles through the available inter wheel diff modes.
Definition: Actor.cpp:1394
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::ActorLinkingRequestType::TIE_TOGGLE
@ TIE_TOGGLE
RoR::GUI::VehicleInfoTPanel::m_stat_mass_Kg
float m_stat_mass_Kg
Definition: GUI_VehicleInfoTPanel.h:82
SOUND_GET_STATE
#define SOUND_GET_STATE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:39
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::Actor::cruisecontrolToggle
void cruisecontrolToggle()
Defined in 'gameplay/CruiseControl.cpp'.
Definition: CruiseControl.cpp:31
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:887
RoR::EV_TRUCK_SHIFT_NEUTRAL
@ EV_TRUCK_SHIFT_NEUTRAL
shift to neutral gear in manual transmission mode
Definition: InputEngine.h:354
RoR::GfxActor::GetSimDataBuffer
ActorSB & GetSimDataBuffer()
Definition: GfxActor.h:119
RoR::Actor::ar_num_shocks
int ar_num_shocks
Number of shock absorbers.
Definition: Actor.h:285
RoR
Definition: AppContext.h:36
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::ActorSB::simbuf_has_engine
bool simbuf_has_engine
Definition: SimBuffers.h:144
RoR::ActorSB::simbuf_engine_torque
float simbuf_engine_torque
Definition: SimBuffers.h:151
DrawSingleButtonRow
bool DrawSingleButtonRow(bool active, const Ogre::TexturePtr &icon, const char *name, RoR::events ev, bool *btn_active=nullptr)
Definition: GUI_VehicleInfoTPanel.cpp:798
RoR::EV_TRUCK_PARKING_BRAKE
@ EV_TRUCK_PARKING_BRAKE
toggle parking brake
Definition: InputEngine.h:327
RoR::COMMANDKEYID_INVALID
static const CommandkeyID_t COMMANDKEYID_INVALID
Definition: ForwardDeclarations.h:75
SOUND_TOGGLE
#define SOUND_TOGGLE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:37
RoR::EV_COMMON_TOGGLE_DEBUG_VIEW
@ EV_COMMON_TOGGLE_DEBUG_VIEW
toggle debug view mode
Definition: InputEngine.h:265
RoR::GUI::VehicleInfoTPanel::DrawHeadLightButton
void DrawHeadLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:824
RoR::EV_TRUCK_ANTILOCK_BRAKE
@ EV_TRUCK_ANTILOCK_BRAKE
toggle antilockbrake system
Definition: InputEngine.h:300
RoR::CameraManager::switchToNextBehavior
void switchToNextBehavior()
Definition: CameraManager.cpp:320
RoR::Actor::getCustomLightVisible
bool getCustomLightVisible(int number)
Definition: Actor.cpp:4473
RoR::beam_t::L
float L
length
Definition: SimData.h:339
RoR::ActorModifyRequest::Type::RESET_ON_SPOT
@ RESET_ON_SPOT
RoR::Actor::displayTransferCaseMode
void displayTransferCaseMode()
Gets the current transfer case mode name (4WD Hi, ...)
Definition: Actor.cpp:1420
RoR::beam_t::bm_broken
bool bm_broken
Definition: SimData.h:352
BUTTON_Y_OFFSET
const float BUTTON_Y_OFFSET
Definition: GUI_VehicleInfoTPanel.cpp:605