RigsofRods
Soft-body Physics Simulation
GUI_VehicleButtons.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-2019 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #include "GUI_VehicleButtons.h"
23 
24 #include "Application.h"
25 #include "Actor.h"
26 #include "GfxActor.h"
27 #include "GUIManager.h"
28 #include "SoundScriptManager.h"
29 #include "GameContext.h"
30 #include "InputEngine.h"
31 #include "EngineSim.h"
32 #include "Console.h"
33 #include "CameraManager.h"
34 #include "GUIUtils.h"
35 
36 #include <Ogre.h>
37 #include <imgui_internal.h>
38 
39 using namespace RoR;
40 using namespace GUI;
41 
43 {
45 
46  ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar;
47  ImGui::SetNextWindowPos(ImVec2(theme.screen_edge_padding.x - ImGui::GetStyle().WindowPadding.x, 100.f));
48  ImVec2 window_pos = ImVec2(158, 0);
49  ImGui::SetNextWindowSize(window_pos);
50  ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0,0,0,0));
51 
52  if (!m_icons_cached)
53  {
54  this->CacheIcons();
55  }
56 
57  bool is_visible = false;
58 
59  // Show only once for 5 sec, with a notice
60  if (App::ui_show_vehicle_buttons->getBool() && actorx && !m_init)
61  {
62  m_timer.reset();
64  fmt::format(_LC("VehicleButtons", "Hover the mouse on the left to see controls")), "lightbulb.png");
65  m_init = true;
66  }
67  if (App::ui_show_vehicle_buttons->getBool() && m_timer.getMilliseconds() < 5000)
68  {
69  is_visible = true;
70  }
71 
72  // Show when mouse is on the left of screen
73  if (App::ui_show_vehicle_buttons->getBool() && App::GetGuiManager()->AreStaticMenusAllowed() &&
74  (ImGui::GetIO().MousePos.x <= window_pos.x + ImGui::GetStyle().WindowPadding.x) && ImGui::GetIO().MousePos.y <= ImGui::GetIO().DisplaySize.y && !ImGui::IsMouseDown(1))
75  {
76  is_visible = true;
77  }
78 
79  ImGui::Begin("VehicleButtons", nullptr, flags);
80 
81  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().ItemInnerSpacing.x); // Align with the buttons
82  if (is_visible && ImGui::CollapsingHeader(_LC("VehicleButtons", "Main Controls")))
83  {
84  this->DrawHeadLightButton(actorx);
85  ImGui::SameLine();
86  this->DrawLeftBlinkerButton(actorx);
87  ImGui::SameLine();
88  this->DrawRightBlinkerButton(actorx);
89  ImGui::SameLine();
90  this->DrawWarnBlinkerButton(actorx);
91  this->DrawShiftModeButton(actorx);
92  ImGui::SameLine();
93  this->DrawEngineButton(actorx);
94  ImGui::SameLine();
95  this->DrawRepairButton(actorx);
96  ImGui::SameLine();
97  this->DrawParkingBrakeButton(actorx);
98  this->DrawTractionControlButton(actorx);
99  ImGui::SameLine();
100  this->DrawAbsButton(actorx);
101  ImGui::SameLine();
102  this->DrawLockButton(actorx);
103  ImGui::SameLine();
104  this->DrawSecureButton(actorx);
105  this->DrawAxleDiffButton(actorx);
106  ImGui::SameLine();
107  this->DrawWheelDiffButton(actorx);
108  ImGui::SameLine();
109  this->DrawTransferCaseModeButton(actorx);
110  ImGui::SameLine();
111  this->DrawTransferCaseGearRatioButton(actorx);
112  this->DrawParticlesButton(actorx);
113  ImGui::SameLine();
114  this->DrawBeaconButton(actorx);
115  ImGui::SameLine();
116  this->DrawHornButton(actorx);
117  ImGui::SameLine();
118  this->DrawMirrorButton(actorx);
119  this->DrawCruiseControlButton(actorx);
120  ImGui::SameLine();
121  this->DrawCameraButton();
122  ImGui::SameLine();
123  this->DrawActorPhysicsButton(actorx);
124  ImGui::SameLine();
125  this->DrawPhysicsButton();
126  }
127 
128  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().ItemInnerSpacing.x); // Align with the buttons
129  if (is_visible && ImGui::CollapsingHeader(_LC("VehicleButtons", "Custom Lights")))
130  {
131  this->DrawCustomLightButton(actorx);
132  }
133 
134  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetStyle().ItemInnerSpacing.x); // Align with the buttons
135  if (is_visible && ImGui::CollapsingHeader(_LC("VehicleButtons", "Commands")))
136  {
137  this->DrawCommandButton(actorx);
138  }
139 
140  ImGui::End();
141  ImGui::PopStyleColor(1); // WindowBg
142 }
143 
145 {
146  bool has_headlight = false;
147  for (int i = 0; i < actorx->GetActor()->ar_flares.size(); i++)
148  {
149  if (actorx->GetActor()->ar_flares[i].fl_type == FlareType::HEADLIGHT || actorx->GetActor()->ar_flares[i].fl_type == FlareType::TAIL_LIGHT)
150  {
151  has_headlight = true;
152  }
153  }
154 
155  if (!has_headlight)
156  {
157  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
158  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
159  }
160  else if (actorx->GetActor()->getHeadlightsVisible())
161  {
162  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
163  }
164  else
165  {
166  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
167  }
168 
169  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_headlight_icon->getHandle()), ImVec2(24, 24)))
170  {
171  actorx->GetActor()->toggleHeadlights();
172  }
173 
174  if (!has_headlight)
175  {
176  ImGui::PopItemFlag();
177  ImGui::PopStyleVar();
178  }
179  else
180  {
181  ImGui::PopStyleColor();
182  }
183 
184  if (ImGui::IsItemHovered())
185  {
186  ImGui::BeginTooltip();
187  ImGui::TextDisabled("%s (%s)", "Head Lights", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS).c_str());
188  ImGui::EndTooltip();
189  }
190 }
191 
193 {
194  bool has_blink = false;
195  for (int i = 0; i < actorx->GetActor()->ar_flares.size(); i++)
196  {
197  if (actorx->GetActor()->ar_flares[i].fl_type == FlareType::BLINKER_LEFT)
198  {
199  has_blink = true;
200  }
201  }
202 
203  if (!has_blink)
204  {
205  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
206  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
207  }
208  else if (actorx->GetActor()->getBlinkType() == BLINK_LEFT)
209  {
210  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
211  }
212  else
213  {
214  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
215  }
216 
217  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_left_blinker_icon->getHandle()), ImVec2(24, 24)))
218  {
219  actorx->GetActor()->toggleBlinkType(BLINK_LEFT);
220  }
221 
222  if (!has_blink)
223  {
224  ImGui::PopItemFlag();
225  ImGui::PopStyleVar();
226  }
227  else
228  {
229  ImGui::PopStyleColor();
230  }
231 
232  if (ImGui::IsItemHovered())
233  {
234  ImGui::BeginTooltip();
235  ImGui::TextDisabled("%s (%s)", "Left Blinker", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_BLINK_LEFT).c_str());
236  ImGui::EndTooltip();
237  }
238 }
239 
241 {
242  bool has_blink = false;
243  for (int i = 0; i < actorx->GetActor()->ar_flares.size(); i++)
244  {
245  if (actorx->GetActor()->ar_flares[i].fl_type == FlareType::BLINKER_RIGHT)
246  {
247  has_blink = true;
248  }
249  }
250 
251  if (!has_blink)
252  {
253  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
254  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
255  }
256  else if (actorx->GetActor()->getBlinkType() == BLINK_RIGHT)
257  {
258  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
259  }
260  else
261  {
262  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
263  }
264 
265  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_right_blinker_icon->getHandle()), ImVec2(24, 24)))
266  {
268  }
269 
270  if (!has_blink)
271  {
272  ImGui::PopItemFlag();
273  ImGui::PopStyleVar();
274  }
275  else
276  {
277  ImGui::PopStyleColor();
278  }
279 
280  if (ImGui::IsItemHovered())
281  {
282  ImGui::BeginTooltip();
283  ImGui::TextDisabled("%s (%s)", "Right Blinker", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_BLINK_RIGHT).c_str());
284  ImGui::EndTooltip();
285  }
286 }
287 
289 {
290  bool has_blink = false;
291  for (int i = 0; i < actorx->GetActor()->ar_flares.size(); i++)
292  {
293  if (actorx->GetActor()->ar_flares[i].fl_type == FlareType::BLINKER_LEFT)
294  {
295  has_blink = true;
296  }
297  }
298 
299  if (!has_blink)
300  {
301  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
302  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
303  }
304  else if (actorx->GetActor()->getBlinkType() == BLINK_WARN)
305  {
306  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
307  }
308  else
309  {
310  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
311  }
312 
313  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_warning_light_icon->getHandle()), ImVec2(24, 24)))
314  {
315  actorx->GetActor()->toggleBlinkType(BLINK_WARN);
316  }
317 
318  if (!has_blink)
319  {
320  ImGui::PopItemFlag();
321  ImGui::PopStyleVar();
322  }
323  else
324  {
325  ImGui::PopStyleColor();
326  }
327 
328  if (ImGui::IsItemHovered())
329  {
330  ImGui::BeginTooltip();
331  ImGui::TextDisabled("%s (%s)", "Warning Lights", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_BLINK_WARN).c_str());
332  ImGui::EndTooltip();
333  }
334 }
335 
337 {
338  if (actorx->GetActor()->getTruckType() != TRUCK)
339  {
340  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
341  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
342  }
343  else if (SOUND_GET_STATE(actorx->GetActor()->ar_instance_id, SS_TRIG_HORN))
344  {
345  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
346  }
347  else
348  {
349  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
350  }
351 
352  if (actorx->GetActor()->ar_is_police) // Police siren
353  {
354  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_horn_icon->getHandle()), ImVec2(24, 24)))
355  {
356  SOUND_TOGGLE(actorx->GetActor(), SS_TRIG_HORN);
357  }
358  }
359  else
360  {
361  // Triggering continuous command every frame is sloppy
362  // Set state and read it in GameContext via GetHornButtonState()
363  ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_horn_icon->getHandle()), ImVec2(24, 24));
364  if (ImGui::IsItemActive())
365  {
366  m_horn = true;
367  }
368  else
369  {
370  m_horn = false;
371  }
372  }
373 
374  if (actorx->GetActor()->getTruckType() != TRUCK)
375  {
376  ImGui::PopItemFlag();
377  ImGui::PopStyleVar();
378  }
379  else
380  {
381  ImGui::PopStyleColor();
382  }
383 
384  if (ImGui::IsItemHovered())
385  {
386  ImGui::BeginTooltip();
387  ImGui::TextDisabled("%s (%s)", "Horn", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_HORN).c_str());
388  ImGui::EndTooltip();
389  }
390 }
391 
393 {
394  if (!actorx->hasCamera())
395  {
396  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
397  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
398  }
400  {
401  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
402  }
403  else
404  {
405  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
406  }
407 
408  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_mirror_icon->getHandle()), ImVec2(24, 24)))
409  {
411  {
413  }
414  else
415  {
417  }
418  }
419 
420  if (!actorx->hasCamera())
421  {
422  ImGui::PopItemFlag();
423  ImGui::PopStyleVar();
424  }
425  else
426  {
427  ImGui::PopStyleColor();
428  }
429 
430  if (ImGui::IsItemHovered())
431  {
432  ImGui::BeginTooltip();
433  ImGui::TextDisabled("%s (%s)", "Mirrors", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_VIDEOCAMERA).c_str());
434  ImGui::EndTooltip();
435  }
436 }
437 
439 {
440  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_REPAIR_TRUCK))
441  {
442  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
443  }
444  else
445  {
446  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
447  }
448 
449  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_repair_icon->getHandle()), ImVec2(24, 24)))
450  {
452  rq->amr_actor = actorx->GetActor()->ar_instance_id;
455  }
456 
457  ImGui::PopStyleColor();
458 
459  if (ImGui::IsItemHovered())
460  {
461  ImGui::BeginTooltip();
462  ImGui::TextDisabled("%s (%s)", "Repair", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_REPAIR_TRUCK).c_str());
463  ImGui::EndTooltip();
464  }
465 }
466 
468 {
469  if (actorx->GetActor()->getTruckType() == NOT_DRIVEABLE || actorx->GetActor()->getTruckType() == BOAT)
470  {
471  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
472  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
473  }
474  else if (actorx->GetActor()->getParkingBrake())
475  {
476  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
477  }
478  else
479  {
480  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
481  }
482 
483  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_parking_brake_icon->getHandle()), ImVec2(24, 24)))
484  {
485  actorx->GetActor()->parkingbrakeToggle();
486  }
487 
488  if (actorx->GetActor()->getTruckType() == NOT_DRIVEABLE || actorx->GetActor()->getTruckType() == BOAT)
489  {
490  ImGui::PopItemFlag();
491  ImGui::PopStyleVar();
492  }
493  else
494  {
495  ImGui::PopStyleColor();
496  }
497 
498  if (ImGui::IsItemHovered())
499  {
500  ImGui::BeginTooltip();
501  ImGui::TextDisabled("%s (%s)", "Parking Brake", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_PARKING_BRAKE).c_str());
502  ImGui::EndTooltip();
503  }
504 }
505 
507 {
508  if (actorx->GetActor()->tc_nodash)
509  {
510  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
511  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
512  }
513  else if (actorx->GetActor()->tc_mode)
514  {
515  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
516  }
517  else
518  {
519  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
520  }
521 
522  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_traction_control_icon->getHandle()), ImVec2(24, 24)))
523  {
524  actorx->GetActor()->tractioncontrolToggle();
525  }
526 
527  if (actorx->GetActor()->tc_nodash)
528  {
529  ImGui::PopItemFlag();
530  ImGui::PopStyleVar();
531  }
532  else
533  {
534  ImGui::PopStyleColor();
535  }
536 
537  if (ImGui::IsItemHovered())
538  {
539  ImGui::BeginTooltip();
540  ImGui::TextDisabled("%s (%s)", "Traction Control", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TRACTION_CONTROL).c_str());
541  ImGui::EndTooltip();
542  }
543 }
544 
546 {
547  if (actorx->GetActor()->alb_nodash)
548  {
549  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
550  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
551  }
552  else if (actorx->GetActor()->alb_mode)
553  {
554  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
555  }
556  else
557  {
558  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
559  }
560 
561  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_abs_icon->getHandle()), ImVec2(24, 24)))
562  {
563  actorx->GetActor()->antilockbrakeToggle();
564  }
565 
566  if (actorx->GetActor()->alb_nodash)
567  {
568  ImGui::PopItemFlag();
569  ImGui::PopStyleVar();
570  }
571  else
572  {
573  ImGui::PopStyleColor();
574  }
575 
576  if (ImGui::IsItemHovered())
577  {
578  ImGui::BeginTooltip();
579  ImGui::TextDisabled("%s (%s)", "ABS", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_ANTILOCK_BRAKE).c_str());
580  ImGui::EndTooltip();
581  }
582 }
583 
585 {
586  if (App::GetGameContext()->GetActorManager()->IsSimulationPaused())
587  {
588  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
589  }
590  else
591  {
592  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
593  }
594 
595  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_physics_icon->getHandle()), ImVec2(24, 24)))
596  {
597  if (App::GetGameContext()->GetActorManager()->IsSimulationPaused())
598  {
600  }
601  else
602  {
604  }
605  }
606 
607  ImGui::PopStyleColor();
608 
609  if (ImGui::IsItemHovered())
610  {
611  ImGui::BeginTooltip();
612  ImGui::TextDisabled("%s (%s)", "Physics", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_PHYSICS).c_str());
613  ImGui::EndTooltip();
614  }
615 }
616 
618 {
619  if (actorx->GetActor()->ar_physics_paused)
620  {
621  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
622  }
623  else
624  {
625  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
626  }
627 
628  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_actor_physics_icon->getHandle()), ImVec2(24, 24)))
629  {
630  for (ActorPtr& actor : actorx->GetActor()->ar_linked_actors)
631  {
632  actor->ar_physics_paused = !actorx->GetActor()->ar_physics_paused;
633  }
634  actorx->GetActor()->ar_physics_paused = !actorx->GetActor()->ar_physics_paused;
635  }
636 
637  ImGui::PopStyleColor();
638 
639  if (ImGui::IsItemHovered())
640  {
641  ImGui::BeginTooltip();
642  ImGui::TextDisabled("%s (%s)", "Actor Physics", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_PHYSICS).c_str());
643  ImGui::EndTooltip();
644  }
645 }
646 
648 {
649  if (actorx->GetActor()->getAxleDiffMode() == 0)
650  {
651  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
652  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
653  }
654  else if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_TOGGLE_INTER_AXLE_DIFF))
655  {
656  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
657  }
658  else
659  {
660  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
661  }
662 
663  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_a_icon->getHandle()), ImVec2(24, 24)))
664  {
665  actorx->GetActor()->toggleAxleDiffMode();
666  actorx->GetActor()->displayAxleDiffMode();
667  }
668 
669  if (actorx->GetActor()->getAxleDiffMode() == 0)
670  {
671  ImGui::PopItemFlag();
672  ImGui::PopStyleVar();
673  }
674  else
675  {
676  ImGui::PopStyleColor();
677  }
678 
679  if (ImGui::IsItemHovered())
680  {
681  ImGui::BeginTooltip();
682  ImGui::TextDisabled("%s (%s)", "Axle Differential", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_INTER_AXLE_DIFF).c_str());
683  ImGui::EndTooltip();
684  }
685 }
686 
688 {
689  if (actorx->GetActor()->getWheelDiffMode() == 0)
690  {
691  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
692  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
693  }
694  else if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF))
695  {
696  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
697  }
698  else
699  {
700  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
701  }
702 
703  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_w_icon->getHandle()), ImVec2(24, 24)))
704  {
705  actorx->GetActor()->toggleWheelDiffMode();
706  actorx->GetActor()->displayWheelDiffMode();
707  }
708 
709  if (actorx->GetActor()->getWheelDiffMode() == 0)
710  {
711  ImGui::PopItemFlag();
712  ImGui::PopStyleVar();
713  }
714  else
715  {
716  ImGui::PopStyleColor();
717  }
718 
719  if (ImGui::IsItemHovered())
720  {
721  ImGui::BeginTooltip();
722  ImGui::TextDisabled("%s (%s)", "Wheel Differential", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF).c_str());
723  ImGui::EndTooltip();
724  }
725 }
726 
728 {
729  if (!actorx->GetActor()->ar_engine || !actorx->GetActor()->getTransferCaseMode() ||
730  actorx->GetActor()->getTransferCaseMode()->tr_ax_2 < 0 || !actorx->GetActor()->getTransferCaseMode()->tr_2wd)
731  {
732  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
733  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
734  }
735  else if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_TOGGLE_TCASE_4WD_MODE))
736  {
737  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
738  }
739  else
740  {
741  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
742  }
743 
744  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_m_icon->getHandle()), ImVec2(24, 24)))
745  {
746  actorx->GetActor()->toggleTransferCaseMode();
747  actorx->GetActor()->displayTransferCaseMode();
748  }
749 
750  if (!actorx->GetActor()->ar_engine || !actorx->GetActor()->getTransferCaseMode() ||
751  actorx->GetActor()->getTransferCaseMode()->tr_ax_2 < 0 || !actorx->GetActor()->getTransferCaseMode()->tr_2wd)
752  {
753  ImGui::PopItemFlag();
754  ImGui::PopStyleVar();
755  }
756  else
757  {
758  ImGui::PopStyleColor();
759  }
760 
761  if (ImGui::IsItemHovered())
762  {
763  ImGui::BeginTooltip();
764  ImGui::TextDisabled("%s (%s)", "Transfer Case 4WD", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_TCASE_4WD_MODE).c_str());
765  ImGui::EndTooltip();
766  }
767 }
768 
770 {
771  if (!actorx->GetActor()->ar_engine || !actorx->GetActor()->getTransferCaseMode() ||
772  actorx->GetActor()->getTransferCaseMode()->tr_gear_ratios.size() < 2)
773  {
774  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
775  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
776  }
777  else if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO))
778  {
779  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
780  }
781  else
782  {
783  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
784  }
785 
786  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_g_icon->getHandle()), ImVec2(24, 24)))
787  {
789  actorx->GetActor()->displayTransferCaseMode();
790  }
791 
792  if (!actorx->GetActor()->ar_engine || !actorx->GetActor()->getTransferCaseMode() ||
793  actorx->GetActor()->getTransferCaseMode()->tr_gear_ratios.size() < 2)
794  {
795  ImGui::PopItemFlag();
796  ImGui::PopStyleVar();
797  }
798  else
799  {
800  ImGui::PopStyleColor();
801  }
802 
803  if (ImGui::IsItemHovered())
804  {
805  ImGui::BeginTooltip();
806  ImGui::TextDisabled("%s (%s)", "Transfer Case Gear Ratio", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO).c_str());
807  ImGui::EndTooltip();
808  }
809 }
810 
812 {
813  if (actorx->GetActor()->ar_num_custom_particles == 0)
814  {
815  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
816  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
817  }
818  else if (actorx->GetActor()->getCustomParticleMode())
819  {
820  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
821  }
822  else
823  {
824  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
825  }
826 
827  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_particle_icon->getHandle()), ImVec2(24, 24)))
828  {
829  actorx->GetActor()->toggleCustomParticles();
830  }
831 
832  if (actorx->GetActor()->ar_num_custom_particles == 0)
833  {
834  ImGui::PopItemFlag();
835  ImGui::PopStyleVar();
836  }
837  else
838  {
839  ImGui::PopStyleColor();
840  }
841 
842  if (ImGui::IsItemHovered())
843  {
844  ImGui::BeginTooltip();
845  ImGui::TextDisabled("%s (%s)", "Particles", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_CUSTOM_PARTICLES).c_str());
846  ImGui::EndTooltip();
847  }
848 }
849 
851 {
852  bool has_beacon = false;
853  for (Prop& prop: actorx->getProps())
854  {
855  if (prop.pp_beacon_type != 0)
856  {
857  has_beacon = true;
858  }
859  }
860 
861  if (!has_beacon)
862  {
863  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
864  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
865  }
866  else if (actorx->GetActor()->getBeaconMode())
867  {
868  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
869  }
870  else
871  {
872  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
873  }
874 
875  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_beacons_icon->getHandle()), ImVec2(24, 24)))
876  {
877  actorx->GetActor()->beaconsToggle();
878  }
879 
880  if (!has_beacon)
881  {
882  ImGui::PopItemFlag();
883  ImGui::PopStyleVar();
884  }
885  else
886  {
887  ImGui::PopStyleColor();
888  }
889 
890  if (ImGui::IsItemHovered())
891  {
892  ImGui::BeginTooltip();
893  ImGui::TextDisabled("%s (%s)", "Beacons", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_TOGGLE_TRUCK_BEACONS).c_str());
894  ImGui::EndTooltip();
895  }
896 }
897 
899 {
900  if (!actorx->GetActor()->ar_engine)
901  {
902  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
903  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
904  }
905  else if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_SWITCH_SHIFT_MODES))
906  {
907  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
908  }
909  else
910  {
911  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
912  }
913 
914  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_shift_icon->getHandle()), ImVec2(24, 24)))
915  {
916  if (actorx->GetActor()->ar_engine)
917  {
918  actorx->GetActor()->ar_engine->ToggleAutoShiftMode();
919  // force gui update
920  actorx->GetActor()->RequestUpdateHudFeatures();
921  const char* msg = nullptr;
922  switch (actorx->GetActor()->ar_engine->GetAutoShiftMode())
923  {
924  case SimGearboxMode::AUTO: msg = "Automatic shift";
925  break;
926  case SimGearboxMode::SEMI_AUTO: msg = "Manual shift - Auto clutch";
927  break;
928  case SimGearboxMode::MANUAL: msg = "Fully Manual: sequential shift";
929  break;
930  case SimGearboxMode::MANUAL_STICK: msg = "Fully manual: stick shift";
931  break;
932  case SimGearboxMode::MANUAL_RANGES: msg = "Fully Manual: stick shift with ranges";
933  break;
934  }
936  }
937  }
938 
939  if (!actorx->GetActor()->ar_engine)
940  {
941  ImGui::PopItemFlag();
942  ImGui::PopStyleVar();
943  }
944  else
945  {
946  ImGui::PopStyleColor();
947  }
948 
949  if (ImGui::IsItemHovered())
950  {
951  ImGui::BeginTooltip();
952  ImGui::TextDisabled("%s (%s)", "Shift Mode", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SWITCH_SHIFT_MODES).c_str());
953 
954  if (actorx->GetActor()->ar_engine)
955  {
956  switch (actorx->GetActor()->ar_engine->GetAutoShiftMode())
957  {
959  ImGui::Separator();
960  ImGui::TextDisabled("%s (%s)", "Shift Up", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_AUTOSHIFT_UP).c_str());
961  ImGui::TextDisabled("%s (%s)", "Shift Down", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_AUTOSHIFT_DOWN).c_str());
962  break;
964  ImGui::Separator();
965  ImGui::TextDisabled("%s (%s)", "Shift Up", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_UP).c_str());
966  ImGui::TextDisabled("%s (%s)", "Shift Down", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_DOWN).c_str());
967  ImGui::TextDisabled("%s (%s)", "Shift Neutral", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_NEUTRAL).c_str());
968  break;
970  ImGui::Separator();
971  ImGui::TextDisabled("%s (%s)", "Shift Up", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_UP).c_str());
972  ImGui::TextDisabled("%s (%s)", "Shift Down", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_DOWN).c_str());
973  ImGui::TextDisabled("%s (%s)", "Shift Neutral", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_SHIFT_NEUTRAL).c_str());
974  ImGui::TextDisabled("%s (%s)", "Clutch", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_MANUAL_CLUTCH).c_str());
975  break;
977  break;
979  break;
980  }
981  }
982  ImGui::EndTooltip();
983  }
984 }
985 
987 {
988  if (!actorx->GetActor()->ar_engine)
989  {
990  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
991  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
992  }
993  else if (actorx->GetActor()->ar_engine->isRunning())
994  {
995  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
996  }
997  else
998  {
999  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1000  }
1001 
1002  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_engine_icon->getHandle()), ImVec2(24, 24)))
1003  {
1004  if (actorx->GetActor()->ar_engine && actorx->GetActor()->ar_engine->isRunning())
1005  {
1006  actorx->GetActor()->ar_engine->toggleContact();
1007  }
1008  else if (actorx->GetActor()->ar_engine)
1009  {
1010  actorx->GetActor()->ar_engine->StartEngine();
1011  }
1012  }
1013 
1014  if (!actorx->GetActor()->ar_engine)
1015  {
1016  ImGui::PopItemFlag();
1017  ImGui::PopStyleVar();
1018  }
1019  else
1020  {
1021  ImGui::PopStyleColor();
1022  }
1023 
1024  if (ImGui::IsItemHovered())
1025  {
1026  ImGui::BeginTooltip();
1027  if (actorx->GetActor()->ar_engine && !actorx->GetActor()->ar_engine->isRunning())
1028  {
1029  ImGui::TextDisabled("%s (%s + %s)", "Start Engine", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_CONTACT).c_str(), App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_STARTER).c_str());
1030  }
1031  else
1032  {
1033  ImGui::TextDisabled("%s (%s)", "Stop Engine", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_TOGGLE_CONTACT).c_str());
1034  }
1035  ImGui::EndTooltip();
1036  }
1037 }
1038 
1040 {
1041  int num_custom_flares = 0;
1042 
1043  for (int i = 0; i < MAX_CLIGHTS; i++)
1044  {
1045  if (actorx->GetActor()->countCustomLights(i) > 0)
1046  {
1047  ImGui::PushID(i);
1048  num_custom_flares++;
1049 
1050  if (i == 5 || i == 9) // Add new line every 4 buttons
1051  {
1052  ImGui::NewLine();
1053  }
1054 
1055  std::string label = "L" + std::to_string(i + 1);
1056 
1057  if (actorx->GetActor()->getCustomLightVisible(i))
1058  {
1059  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1060  }
1061  else
1062  {
1063  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1064  }
1065 
1066  if (ImGui::Button(label.c_str(), ImVec2(32, 0)))
1067  {
1068  actorx->GetActor()->setCustomLightVisible(i, !actorx->GetActor()->getCustomLightVisible(i));
1069  }
1070  if (ImGui::IsItemHovered())
1071  {
1072  ImGui::BeginTooltip();
1073  ImGui::TextDisabled("%s %d (%s)", "Custom Light", i + 1, App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_LIGHTTOGGLE01 + i).c_str());
1074  ImGui::EndTooltip();
1075  }
1076  ImGui::SameLine();
1077 
1078  ImGui::PopStyleColor();
1079  ImGui::PopID();
1080  }
1081  }
1082  if (num_custom_flares > 0)
1083  {
1084  ImGui::NewLine();
1085  }
1086 }
1087 
1089 {
1090  // BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
1091  m_id.resize(MAX_COMMANDS + 1);
1092  for (int i = 1; i <= MAX_COMMANDS; i++)
1093  {
1094  if (actorx->GetActor()->ar_command_key[i].description == "hide")
1095  continue;
1096  if (actorx->GetActor()->ar_command_key[i].beams.empty() && actorx->GetActor()->ar_command_key[i].rotators.empty())
1097  continue;
1098 
1099  ImGui::PushID(i);
1100 
1101  std::string label = "C" + std::to_string(i);
1102  int eventID = RoR::InputEngine::resolveEventName(fmt::format("COMMANDS_{:02d}", i));
1103 
1104  if (actorx->GetActor()->ar_command_key[i].playerInputValue != 0.0f)
1105  {
1106  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1107  }
1108  else
1109  {
1110  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1111  }
1112 
1113  // Triggering continuous command every frame is sloppy
1114  // Set state and read it in GameContext via GetCommandEventID()
1115  ImGui::Button(label.c_str(), ImVec2(32, 0));
1116  if (ImGui::IsItemActive())
1117  {
1118  m_id[i] = eventID;
1119  }
1120  else
1121  {
1122  m_id[i] = -1;
1123  }
1124  if (ImGui::IsItemHovered())
1125  {
1126  ImGui::BeginTooltip();
1127  std::string desc = "unknown function";
1128 
1129  if (!actorx->GetActor()->ar_command_key[i].description.empty())
1130  {
1131  desc = actorx->GetActor()->ar_command_key[i].description.c_str();
1132  }
1133 
1134  ImGui::TextDisabled("%s (%s)", desc.c_str(), App::GetInputEngine()->getEventCommandTrimmed(eventID).c_str());
1135  ImGui::EndTooltip();
1136  }
1137  ImGui::SameLine();
1138 
1139  if (ImGui::GetCursorPos().x > 150) // Add new line approximately every 4 buttons
1140  {
1141  ImGui::NewLine();
1142  }
1143 
1144  ImGui::PopStyleColor();
1145  ImGui::PopID();
1146  }
1147 }
1148 
1150 {
1151  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_camera_icon->getHandle()), ImVec2(24, 24)))
1152  {
1153  if (App::GetCameraManager()->EvaluateSwitchBehavior())
1154  {
1156  }
1157  }
1158  if (ImGui::IsItemHovered())
1159  {
1160  ImGui::BeginTooltip();
1161  ImGui::TextDisabled("%s (%s)", "Switch Camera", App::GetInputEngine()->getEventCommandTrimmed(EV_CAMERA_CHANGE).c_str());
1162  ImGui::EndTooltip();
1163  }
1164 }
1165 
1167 {
1168  if (actorx->GetActor()->ar_hooks.empty())
1169  {
1170  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
1171  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
1172  }
1173  else if (actorx->GetActor()->isLocked())
1174  {
1175  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1176  }
1177  else
1178  {
1179  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1180  }
1181 
1182  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_lock_icon->getHandle()), ImVec2(24, 24)))
1183  {
1184  //actorx->GetActor()->hookToggle(-1, HOOK_TOGGLE, -1);
1185  ActorLinkingRequest* hook_rq = new ActorLinkingRequest();
1187  hook_rq->alr_actor_instance_id = actorx->GetActor()->ar_instance_id;
1189 
1190  //actorx->GetActor()->toggleSlideNodeLock();
1191  ActorLinkingRequest* slidenode_rq = new ActorLinkingRequest();
1193  hook_rq->alr_actor_instance_id = actorx->GetActor()->ar_instance_id;
1195  }
1196 
1197  if (actorx->GetActor()->ar_hooks.empty())
1198  {
1199  ImGui::PopItemFlag();
1200  ImGui::PopStyleVar();
1201  }
1202  else
1203  {
1204  ImGui::PopStyleColor();
1205  }
1206 
1207  if (ImGui::IsItemHovered())
1208  {
1209  ImGui::BeginTooltip();
1210  ImGui::TextDisabled("%s (%s)", "Lock", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_LOCK).c_str());
1211  ImGui::EndTooltip();
1212  }
1213 }
1214 
1216 {
1217  if (actorx->GetActor()->ar_ties.empty())
1218  {
1219  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
1220  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
1221  }
1222  else if (actorx->GetActor()->isTied())
1223  {
1224  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1225  }
1226  else
1227  {
1228  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1229  }
1230 
1231  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_secure_icon->getHandle()), ImVec2(24, 24)))
1232  {
1233  actorx->GetActor()->ar_toggle_ties = true;
1234  }
1235 
1236  if (actorx->GetActor()->ar_ties.empty())
1237  {
1238  ImGui::PopItemFlag();
1239  ImGui::PopStyleVar();
1240  }
1241  else
1242  {
1243  ImGui::PopStyleColor();
1244  }
1245 
1246  if (ImGui::IsItemHovered())
1247  {
1248  ImGui::BeginTooltip();
1249  ImGui::TextDisabled("%s (%s)", "Secure", App::GetInputEngine()->getEventCommandTrimmed(EV_COMMON_SECURE_LOAD).c_str());
1250  ImGui::EndTooltip();
1251  }
1252 }
1253 
1255 {
1256  if (!actorx->GetActor()->ar_engine)
1257  {
1258  ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
1259  ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
1260  }
1261  else if (actorx->GetActor()->cc_mode)
1262  {
1263  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ButtonActive]);
1264  }
1265  else
1266  {
1267  ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_Button]);
1268  }
1269 
1270  if (ImGui::ImageButton(reinterpret_cast<ImTextureID>(m_cruise_control_icon->getHandle()), ImVec2(24, 24)))
1271  {
1272  actorx->GetActor()->cruisecontrolToggle();
1273  }
1274 
1275  if (!actorx->GetActor()->ar_engine)
1276  {
1277  ImGui::PopItemFlag();
1278  ImGui::PopStyleVar();
1279  }
1280  else
1281  {
1282  ImGui::PopStyleColor();
1283  }
1284 
1285  if (ImGui::IsItemHovered())
1286  {
1287  ImGui::BeginTooltip();
1288  ImGui::TextDisabled("%s (%s)", "Cruise Control", App::GetInputEngine()->getEventCommandTrimmed(EV_TRUCK_CRUISE_CONTROL).c_str());
1289  ImGui::EndTooltip();
1290  }
1291 }
1292 
1294 {
1295  // Icons used https://materialdesignicons.com/
1296  // Licence https://github.com/Templarian/MaterialDesign/blob/master/LICENSE
1297 
1298  m_headlight_icon = FetchIcon("car-light-high.png");
1299  m_left_blinker_icon = FetchIcon("arrow-left-bold.png");
1300  m_right_blinker_icon = FetchIcon("arrow-right-bold.png");
1301  m_warning_light_icon = FetchIcon("hazard-lights.png");
1302  m_horn_icon = FetchIcon("bugle.png");
1303  m_mirror_icon = FetchIcon("mirror-rectangle.png");
1304  m_repair_icon = FetchIcon("car-wrench.png");
1305  m_parking_brake_icon = FetchIcon("car-brake-alert.png");
1306  m_traction_control_icon = FetchIcon("car-traction-control.png");
1307  m_abs_icon = FetchIcon("car-brake-abs.png");
1308  m_physics_icon = FetchIcon("pause.png");
1309  m_actor_physics_icon = FetchIcon("pause-circle-outline.png");
1310  m_a_icon = FetchIcon("alpha-a-circle.png");
1311  m_w_icon = FetchIcon("alpha-w-circle.png");
1312  m_m_icon = FetchIcon("alpha-m-circle.png");
1313  m_g_icon = FetchIcon("alpha-g-circle.png");
1314  m_particle_icon = FetchIcon("water.png");
1315  m_shift_icon = FetchIcon("car-shift-pattern.png");
1316  m_engine_icon = FetchIcon("engine.png");
1317  m_beacons_icon = FetchIcon("alarm-light-outline.png");
1318  m_camera_icon = FetchIcon("camera-switch-outline.png");
1319  m_lock_icon = FetchIcon("alpha-l-circle.png");
1320  m_secure_icon = FetchIcon("lock-outline.png");
1321  m_cruise_control_icon = FetchIcon("car-cruise-control.png");
1322 
1323  m_icons_cached = true;
1324 }
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::VehicleButtons::DrawParticlesButton
void DrawParticlesButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:811
MAX_COMMANDS
static const int MAX_COMMANDS
maximum number of commands per actor
Definition: SimConstants.h:28
RoR::TransferCase::tr_ax_2
int tr_ax_2
This axle is only driven in 4WD mode.
Definition: Differentials.h:50
RoR::Actor::cc_mode
bool cc_mode
Cruise Control.
Definition: Actor.h:358
RoR::GUI::VehicleButtons::CacheIcons
void CacheIcons()
Definition: GUI_VehicleButtons.cpp:1293
RoR::Actor::getWheelDiffMode
int getWheelDiffMode()
Writes info to console/notify box.
Definition: Actor.h:151
RoR::InputEngine::getEventCommandTrimmed
std::string getEventCommandTrimmed(int eventID)
Omits 'EXPL' modifier.
Definition: InputEngine.cpp:788
RoR::GUI::VehicleButtons::m_warning_light_icon
Ogre::TexturePtr m_warning_light_icon
Definition: GUI_VehicleButtons.h:80
RoR::Actor::getBeaconMode
bool getBeaconMode() const
Definition: Actor.h:169
RoR::EngineSim::isRunning
bool isRunning() const
Definition: EngineSim.h:93
RoR::EV_TRUCK_SHIFT_UP
@ EV_TRUCK_SHIFT_UP
shift one gear up in manual transmission mode
Definition: InputEngine.h:355
RoR::MSG_SIM_MODIFY_ACTOR_REQUESTED
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
Definition: Application.h:120
RoR::FetchIcon
Ogre::TexturePtr FetchIcon(const char *name)
Definition: GUIUtils.cpp:343
RoR::EV_COMMON_REPAIR_TRUCK
@ EV_COMMON_REPAIR_TRUCK
repair truck to original condition
Definition: InputEngine.h:250
RoR::EV_TRUCK_TOGGLE_CONTACT
@ EV_TRUCK_TOGGLE_CONTACT
toggle ignition
Definition: InputEngine.h:360
RoR::EV_COMMON_TOGGLE_PHYSICS
@ EV_COMMON_TOGGLE_PHYSICS
toggle physics on/off
Definition: InputEngine.h:271
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:92
RoR::GUI::VehicleButtons::DrawCameraButton
void DrawCameraButton()
Definition: GUI_VehicleButtons.cpp:1149
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::Actor::toggleAxleDiffMode
void toggleAxleDiffMode()
Definition: Actor.cpp:1358
RoR::GUI::VehicleButtons::m_lock_icon
Ogre::TexturePtr m_lock_icon
Definition: GUI_VehicleButtons.h:98
MAX_CLIGHTS
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
Definition: SimConstants.h:35
RoR::GUIManager::GuiTheme
Definition: GUIManager.h:70
RoR::GUI::VehicleButtons::m_camera_icon
Ogre::TexturePtr m_camera_icon
Definition: GUI_VehicleButtons.h:97
RoR::GUI::VehicleButtons::DrawTransferCaseGearRatioButton
void DrawTransferCaseGearRatioButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:769
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:275
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:269
RoR::ActorLinkingRequest
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
Definition: SimData.h:916
RoR::Actor::ar_linked_actors
ActorPtrVec ar_linked_actors
BEWARE: Includes indirect links, see DetermineLinkedActors(); Other actors linked using 'hooks/ties/r...
Definition: Actor.h:441
RoR::EngineSim::ToggleAutoShiftMode
void ToggleAutoShiftMode()
Definition: EngineSim.cpp:818
RoR::Actor::getCustomParticleMode
bool getCustomParticleMode()
Definition: Actor.cpp:4551
RoR::GUI::VehicleButtons::m_init
bool m_init
Definition: GUI_VehicleButtons.h:73
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:370
RoR::GUI::VehicleButtons::m_particle_icon
Ogre::TexturePtr m_particle_icon
Definition: GUI_VehicleButtons.h:93
RoR::GUI::VehicleButtons::m_actor_physics_icon
Ogre::TexturePtr m_actor_physics_icon
Definition: GUI_VehicleButtons.h:88
RoR::GUI::VehicleButtons::m_w_icon
Ogre::TexturePtr m_w_icon
Definition: GUI_VehicleButtons.h:90
RoR::GUI::VehicleButtons::DrawCommandButton
void DrawCommandButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:1088
RoR::GUI::VehicleButtons::m_shift_icon
Ogre::TexturePtr m_shift_icon
Definition: GUI_VehicleButtons.h:94
RoR::Actor::toggleWheelDiffMode
void toggleWheelDiffMode()
Definition: Actor.cpp:1350
format
Truck file format(technical spec)
GUIUtils.h
RoR::TransferCase::tr_2wd
bool tr_2wd
Does it support 2WD mode?
Definition: Differentials.h:51
RoR::GUI::VehicleButtons::m_abs_icon
Ogre::TexturePtr m_abs_icon
Definition: GUI_VehicleButtons.h:86
RoR::GUI::VehicleButtons::DrawRightBlinkerButton
void DrawRightBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:240
RoR::GfxActor::GetActor
ActorPtr GetActor()
Definition: GfxActor.cpp:288
RoR::EV_TRUCK_BLINK_WARN
@ EV_TRUCK_BLINK_WARN
toggle all direction indicators
Definition: InputEngine.h:305
RoR::GUI::VehicleButtons::m_horn_icon
Ogre::TexturePtr m_horn_icon
Definition: GUI_VehicleButtons.h:81
RoR::ActorLinkingRequest::alr_type
ActorLinkingRequestType alr_type
Definition: SimData.h:919
RoR::Actor::ar_engine
EngineSim * ar_engine
Definition: Actor.h:373
RoR::GUI::VehicleButtons::DrawEngineButton
void DrawEngineButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:986
RoR::GUI::VehicleButtons::DrawMirrorButton
void DrawMirrorButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:392
RoR::EV_TRUCK_CRUISE_CONTROL
@ EV_TRUCK_CRUISE_CONTROL
toggle cruise control
Definition: InputEngine.h:309
CameraManager.h
RoR::Actor::RequestUpdateHudFeatures
void RequestUpdateHudFeatures()
Definition: Actor.h:264
RoR::ActorLinkingRequestType::HOOK_TOGGLE
@ HOOK_TOGGLE
RoR::GUI::VehicleButtons::m_physics_icon
Ogre::TexturePtr m_physics_icon
Definition: GUI_VehicleButtons.h:87
RoR::Actor::toggleCustomParticles
void toggleCustomParticles()
Definition: Actor.cpp:3174
Console.h
RoR::GUI::VehicleButtons::DrawTractionControlButton
void DrawTractionControlButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:506
RoR::FlareType::HEADLIGHT
@ HEADLIGHT
RoR::GUI::VehicleButtons::m_repair_icon
Ogre::TexturePtr m_repair_icon
Definition: GUI_VehicleButtons.h:83
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::EV_TRUCK_TRACTION_CONTROL
@ EV_TRUCK_TRACTION_CONTROL
toggle antilockbrake system
Definition: InputEngine.h:369
RoR::GUI::VehicleButtons::DrawParkingBrakeButton
void DrawParkingBrakeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:467
RoR::Actor::ar_ties
std::vector< tie_t > ar_ties
Definition: Actor.h:295
RoR::EV_TRUCK_SHIFT_DOWN
@ EV_TRUCK_SHIFT_DOWN
shift one gear down in manual transmission mode
Definition: InputEngine.h:331
RoR::GUI::VehicleButtons::m_a_icon
Ogre::TexturePtr m_a_icon
Definition: GUI_VehicleButtons.h:89
RoR::GUI::VehicleButtons::DrawWheelDiffButton
void DrawWheelDiffButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:687
RoR::TransferCase::tr_gear_ratios
std::vector< float > tr_gear_ratios
Gear reduction ratios.
Definition: Differentials.h:54
RoR::NOT_DRIVEABLE
@ NOT_DRIVEABLE
not drivable at all
Definition: SimData.h:91
RoR::FlareType::TAIL_LIGHT
@ TAIL_LIGHT
RoR::Actor::displayAxleDiffMode
void displayAxleDiffMode()
Cycles through the available inter axle diff modes.
Definition: Actor.cpp:1366
RoR::GUI::VehicleButtons::DrawBeaconButton
void DrawBeaconButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:850
RoR::Actor::tractioncontrolToggle
void tractioncontrolToggle()
Definition: Actor.cpp:3786
RefCountingObjectPtr< Actor >
RoR::GUI::VehicleButtons::DrawActorPhysicsButton
void DrawActorPhysicsButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:617
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::VehicleButtons::Draw
void Draw(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:42
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::SimGearboxMode::AUTO
@ AUTO
Automatic shift.
RoR::GUI::VehicleButtons::m_id
std::vector< int > m_id
Definition: GUI_VehicleButtons.h:71
RoR::ActorModifyRequest::amr_actor
ActorInstanceID_t amr_actor
Definition: SimData.h:885
RoR::SimGearboxMode::MANUAL_STICK
@ MANUAL_STICK
Fully manual: stick shift.
RoR::GUI::VehicleButtons::m_m_icon
Ogre::TexturePtr m_m_icon
Definition: GUI_VehicleButtons.h:91
RoR::GUI::VehicleButtons::DrawAbsButton
void DrawAbsButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:545
RoR::GfxActor::GetVideoCamState
VideoCamState GetVideoCamState() const
Definition: GfxActor.h:137
RoR::GUIManager::GetTheme
GuiTheme & GetTheme()
Definition: GUIManager.h:158
RoR::GUI::VehicleButtons::m_left_blinker_icon
Ogre::TexturePtr m_left_blinker_icon
Definition: GUI_VehicleButtons.h:78
RoR::Actor::ar_flares
std::vector< flare_t > ar_flares
Definition: Actor.h:297
RoR::ActorModifyRequest
Definition: SimData.h:869
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::Actor::getTransferCaseMode
TransferCase * getTransferCaseMode()
Toggles between 2WD and 4WD mode.
Definition: Actor.h:153
RoR::GUI::VehicleButtons::DrawPhysicsButton
void DrawPhysicsButton()
Definition: GUI_VehicleButtons.cpp:584
RoR::Actor::ar_num_custom_particles
int ar_num_custom_particles
Definition: Actor.h:320
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:66
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::GUI::VehicleButtons::m_icons_cached
bool m_icons_cached
Definition: GUI_VehicleButtons.h:76
RoR::EV_TRUCK_TOGGLE_TCASE_4WD_MODE
@ EV_TRUCK_TOGGLE_TCASE_4WD_MODE
toggle the transfer case 4wd mode
Definition: InputEngine.h:366
RoR::EV_TRUCK_TOGGLE_VIDEOCAMERA
@ EV_TRUCK_TOGGLE_VIDEOCAMERA
toggle videocamera update
Definition: InputEngine.h:368
RoR::BLINK_RIGHT
@ BLINK_RIGHT
Definition: SimData.h:124
RoR::BLINK_WARN
@ BLINK_WARN
Definition: SimData.h:125
RoR::GUI::VehicleButtons::DrawHornButton
void DrawHornButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:336
RoR::Prop
A mesh attached to vehicle frame via 3 nodes.
Definition: GfxData.h:160
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::VehicleButtons::DrawCruiseControlButton
void DrawCruiseControlButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:1254
RoR::Actor::isTied
bool isTied()
Definition: Actor.cpp:3870
RoR::EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
@ EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
toggle the inter wheel differential mode
Definition: InputEngine.h:364
SoundScriptManager.h
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RoR::InputEngine::resolveEventName
static int resolveEventName(Ogre::String eventName)
Definition: InputEngine.cpp:2000
RoR::EV_TRUCK_HORN
@ EV_TRUCK_HORN
truck horn
Definition: InputEngine.h:313
GUI_VehicleButtons.h
RoR::EV_COMMON_SECURE_LOAD
@ EV_COMMON_SECURE_LOAD
tie a load to the truck
Definition: InputEngine.h:263
RoR::BLINK_LEFT
@ BLINK_LEFT
Definition: SimData.h:123
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::VehicleButtons::DrawLeftBlinkerButton
void DrawLeftBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:192
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::GUI::VehicleButtons::m_mirror_icon
Ogre::TexturePtr m_mirror_icon
Definition: GUI_VehicleButtons.h:82
RoR::Actor::tc_mode
bool tc_mode
Traction control state; Enabled? {1/0}.
Definition: Actor.h:351
RoR::GUI::VehicleButtons::DrawCustomLightButton
void DrawCustomLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:1039
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::GUI::VehicleButtons::m_parking_brake_icon
Ogre::TexturePtr m_parking_brake_icon
Definition: GUI_VehicleButtons.h:84
RoR::GfxActor::hasCamera
bool hasCamera()
Definition: GfxActor.h:149
RoR::SimGearboxMode::MANUAL
@ MANUAL
Fully manual: sequential shift.
RoR::Actor::toggleTransferCaseMode
void toggleTransferCaseMode()
Definition: Actor.cpp:1434
RoR::Actor::parkingbrakeToggle
void parkingbrakeToggle()
Definition: Actor.cpp:3762
RoR::GUI::VehicleButtons::m_engine_icon
Ogre::TexturePtr m_engine_icon
Definition: GUI_VehicleButtons.h:95
RoR::GUI::VehicleButtons::m_right_blinker_icon
Ogre::TexturePtr m_right_blinker_icon
Definition: GUI_VehicleButtons.h:79
RoR::GUIManager::GuiTheme::screen_edge_padding
ImVec2 screen_edge_padding
Definition: GUIManager.h:87
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::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::EV_TRUCK_MANUAL_CLUTCH
@ EV_TRUCK_MANUAL_CLUTCH
manual clutch (for manual transmission)
Definition: InputEngine.h:326
RoR::EV_CAMERA_CHANGE
@ EV_CAMERA_CHANGE
change camera mode
Definition: InputEngine.h:114
RoR::Actor::ar_toggle_ties
bool ar_toggle_ties
Sim state.
Definition: Actor.h:477
RoR::VideoCamState::VCSTATE_ENABLED_ONLINE
@ VCSTATE_ENABLED_ONLINE
RoR::GUI::VehicleButtons::DrawWarnBlinkerButton
void DrawWarnBlinkerButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:288
RoR::GUI::VehicleButtons::m_timer
Ogre::Timer m_timer
Definition: GUI_VehicleButtons.h:72
RoR::Actor::toggleBlinkType
void toggleBlinkType(BlinkType blink)
Definition: Actor.cpp:3080
RoR::MSG_SIM_ACTOR_LINKING_REQUESTED
@ MSG_SIM_ACTOR_LINKING_REQUESTED
Payload = RoR::ActorLinkingRequest* (owner)
Definition: Application.h:128
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::Actor::alb_nodash
bool alb_nodash
Anti-lock brake attribute: Hide the dashboard indicator?
Definition: Actor.h:347
RoR::GfxActor::getProps
std::vector< Prop > & getProps()
Definition: GfxActor.h:148
RoR::EngineSim::StartEngine
void StartEngine()
Quick engine start. Plays sounds.
Definition: EngineSim.cpp:998
RoR::GUI::VehicleButtons::DrawSecureButton
void DrawSecureButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:1215
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::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:918
RoR::Actor::setCustomLightVisible
void setCustomLightVisible(int number, bool visible)
Definition: Actor.cpp:4495
RoR::ActorManager::SetSimulationPaused
void SetSimulationPaused(bool v)
Definition: ActorManager.h:95
RoR::GUI::VehicleButtons::DrawLockButton
void DrawLockButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:1166
RoR::EV_COMMON_TOGGLE_CUSTOM_PARTICLES
@ EV_COMMON_TOGGLE_CUSTOM_PARTICLES
toggle particle cannon
Definition: InputEngine.h:268
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::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.
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
GfxActor.h
Manager for all visuals belonging to a single actor.
RoR::GUI::VehicleButtons::m_traction_control_icon
Ogre::TexturePtr m_traction_control_icon
Definition: GUI_VehicleButtons.h:85
RoR::Actor::countCustomLights
int countCustomLights(int control_number)
Definition: Actor.cpp:4515
RoR::ActorLinkingRequestType::SLIDENODE_TOGGLE
@ SLIDENODE_TOGGLE
RoR::GUI::VehicleButtons::m_horn
bool m_horn
Definition: GUI_VehicleButtons.h:70
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::GUI::VehicleButtons::m_cruise_control_icon
Ogre::TexturePtr m_cruise_control_icon
Definition: GUI_VehicleButtons.h:100
RoR::Actor::getBlinkType
BlinkType getBlinkType()
Definition: Actor.cpp:4543
RoR::GUI::VehicleButtons::DrawHeadLightButton
void DrawHeadLightButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:144
RoR::GUI::VehicleButtons::DrawAxleDiffButton
void DrawAxleDiffButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:647
RoR::BOAT
@ BOAT
its a boat
Definition: SimData.h:94
RoR::GUI::VehicleButtons::DrawTransferCaseModeButton
void DrawTransferCaseModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:727
RoR::Actor::displayWheelDiffMode
void displayWheelDiffMode()
Cycles through the available inter wheel diff modes.
Definition: Actor.cpp:1394
RoR::GUI::VehicleButtons::m_g_icon
Ogre::TexturePtr m_g_icon
Definition: GUI_VehicleButtons.h:92
SOUND_GET_STATE
#define SOUND_GET_STATE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:39
RoR::Actor::cruisecontrolToggle
void cruisecontrolToggle()
Defined in 'gameplay/CruiseControl.cpp'.
Definition: CruiseControl.cpp:31
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:886
RoR::GUI::VehicleButtons::m_secure_icon
Ogre::TexturePtr m_secure_icon
Definition: GUI_VehicleButtons.h:99
RoR::EV_TRUCK_SHIFT_NEUTRAL
@ EV_TRUCK_SHIFT_NEUTRAL
shift to neutral gear in manual transmission mode
Definition: InputEngine.h:354
RoR
Definition: AppContext.h:36
RoR::GUI::VehicleButtons::DrawShiftModeButton
void DrawShiftModeButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:898
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::GUI::VehicleButtons::m_beacons_icon
Ogre::TexturePtr m_beacons_icon
Definition: GUI_VehicleButtons.h:96
RoR::GUI::VehicleButtons::DrawRepairButton
void DrawRepairButton(RoR::GfxActor *actorx)
Definition: GUI_VehicleButtons.cpp:438
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127
RoR::EV_TRUCK_PARKING_BRAKE
@ EV_TRUCK_PARKING_BRAKE
toggle parking brake
Definition: InputEngine.h:327
RoR::GUI::VehicleButtons::m_headlight_icon
Ogre::TexturePtr m_headlight_icon
Definition: GUI_VehicleButtons.h:77
SOUND_TOGGLE
#define SOUND_TOGGLE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:37
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::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