Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VInfoAutoHover.c
Go to the documentation of this file.
2 {
3  protected SCR_HelicopterControllerComponent m_HelicoperController;
4  protected SignalsManagerComponent m_SignalsManager;
5 
6  protected int m_iSignalIndexSpeed;
7  protected const string SIGNAL_SPEED = "airspeed";
8 
9  protected int m_iSignalIndexAlt;
10  protected const string SIGNAL_ALTITUDE = "altitudeAGL";
11 
12  //------------------------------------------------------------------------------------------------
14  override EVehicleInfoState GetState()
15  {
16  if (!m_HelicoperController || !m_SignalsManager)
17  return EVehicleInfoState.DISABLED;
18 
19  m_bIsBlinking = false;
20 
21  float speed = m_SignalsManager.GetSignalValue(m_iSignalIndexSpeed);
22  float alt = m_SignalsManager.GetSignalValue(m_iSignalIndexAlt);
23 
24  bool bIsAutoHoverOn = m_HelicoperController.GetAutohoverEnabled();
25 
26  if (!bIsAutoHoverOn)
27  return EVehicleInfoState.DISABLED;
28 
29  EVehicleInfoState state;
30 
31  if (speed > 20 && alt > 1)
32  {
33  state = EVehicleInfoState.WARNING;
34  }
35  else
36  {
37  state = EVehicleInfoState.ENABLED;
38  }
39 
40  return state;
41  }
42 
43  //------------------------------------------------------------------------------------------------
45  override void DisplayInit(IEntity owner)
46  {
47  super.DisplayInit(owner);
48 
49  m_HelicoperController = SCR_HelicopterControllerComponent.Cast(owner.FindComponent(SCR_HelicopterControllerComponent));
50 
51  if (!m_HelicoperController)
52  return;
53 
54  m_SignalsManager = m_HelicoperController.GetSignalsManager();
55 
56  if (!m_SignalsManager)
57  return;
58 
59  m_iSignalIndexSpeed = m_SignalsManager.FindSignal(SIGNAL_SPEED);
60  m_iSignalIndexAlt = m_SignalsManager.FindSignal(SIGNAL_ALTITUDE);
61  }
62 };
SCR_BaseVehicleInfo
Base class for all vehicle UI state and damage indicators.
Definition: SCR_BaseVehicleInfo.c:28
m_SignalsManager
protected SignalsManagerComponent m_SignalsManager
Definition: SCR_VehicleDamageManagerComponent.c:208
EVehicleInfoState
EVehicleInfoState
UI indicator state, controlling colors and opacity.
Definition: SCR_BaseVehicleInfo.c:5
SCR_VInfoAutoHover
Definition: SCR_VInfoAutoHover.c:1