Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HandBrakeInfo.c
Go to the documentation of this file.
2 {
3  protected CarControllerComponent m_pCarController;
4  protected CarControllerComponent_SA m_pCarController_SA;
5 
6  //------------------------------------------------------------------------------------------------
8  override EVehicleInfoState GetState()
9  {
11  {
12  if (!m_pCarController)
13  return EVehicleInfoState.DISABLED;
14 
15  EVehicleInfoState state = EVehicleInfoState.DISABLED;
16  m_bIsBlinking = false;
17  if (m_pCarController.GetHandBrake() || m_pCarController.GetPersistentHandBrake())
18  {
19  VehicleWheeledSimulation simulation = m_pCarController.GetSimulation();
20  if (m_pCarController.IsEngineOn() && simulation && simulation.GetSpeedKmh() > 1)
21  state = EVehicleInfoState.WARNING;
22  else
23  state = EVehicleInfoState.ENABLED;
24  }
25 
26  return state;
27  }
28  else
29  {
30  if (!m_pCarController_SA)
31  return EVehicleInfoState.DISABLED;
32 
33  EVehicleInfoState state = EVehicleInfoState.DISABLED;
34  m_bIsBlinking = false;
35  if (m_pCarController_SA.GetHandBrake() || m_pCarController_SA.GetPersistentHandBrake())
36  {
37  VehicleWheeledSimulation_SA simulation = m_pCarController_SA.GetSimulation();
38  if (m_pCarController_SA.IsEngineOn() && simulation && simulation.GetSpeedKmh() > 1)
39  state = EVehicleInfoState.WARNING;
40  else
41  state = EVehicleInfoState.ENABLED;
42  }
43 
44  return state;
45  }
46  }
47 
48  //------------------------------------------------------------------------------------------------
50  override void DisplayInit(IEntity owner)
51  {
52  super.DisplayInit(owner);
53 
55  m_pCarController = CarControllerComponent.Cast(owner.FindComponent(CarControllerComponent));
56  else
57  m_pCarController_SA = CarControllerComponent_SA.Cast(owner.FindComponent(CarControllerComponent_SA));
58  }
59 };
SCR_BaseVehicleInfo
Base class for all vehicle UI state and damage indicators.
Definition: SCR_BaseVehicleInfo.c:28
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GetIsClientAuthority
override bool GetIsClientAuthority()
Definition: game.c:268
EVehicleInfoState
EVehicleInfoState
UI indicator state, controlling colors and opacity.
Definition: SCR_BaseVehicleInfo.c:5
SCR_HandBrakeInfo
Definition: SCR_HandBrakeInfo.c:1