Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HZInfoHeli.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  EVehicleInfoState state = super.GetState();
17 
18  m_bIsBlinking = false;
19 
20  if (!m_HelicoperController || !m_SignalsManager)
21  return state;
22 
23  //4ZGUBA: We can make the indicators for damaged hitzones blink, if heli is flying; or not :-)
24  float speed = m_SignalsManager.GetSignalValue(m_iSignalIndexSpeed);
25  float alt = m_SignalsManager.GetSignalValue(m_iSignalIndexAlt);
26  m_bIsBlinking = state == EVehicleInfoState.ERROR && (alt > 5 || speed > 5);
27 
28  return state;
29  }
30 
31  //------------------------------------------------------------------------------------------------
33  override void DisplayInit(IEntity owner)
34  {
35  super.DisplayInit(owner);
36 
37  m_HelicoperController = SCR_HelicopterControllerComponent.Cast(owner.FindComponent(SCR_HelicopterControllerComponent));
38 
39  if (!m_HelicoperController)
40  return;
41 
42  m_SignalsManager = m_HelicoperController.GetSignalsManager();
43 
44  if (!m_SignalsManager)
45  return;
46 
47  m_iSignalIndexSpeed = m_SignalsManager.AddOrFindSignal(SIGNAL_SPEED);
48  m_iSignalIndexAlt = m_SignalsManager.AddOrFindSignal(SIGNAL_ALTITUDE);
49  }
50 };
SCR_HitZoneInfo
Definition: SCR_HitZoneInfo.c:4
m_SignalsManager
protected SignalsManagerComponent m_SignalsManager
Definition: SCR_VehicleDamageManagerComponent.c:208
SCR_HZInfoHeli
Definition: SCR_HZInfoHeli.c:1
EVehicleInfoState
EVehicleInfoState
UI indicator state, controlling colors and opacity.
Definition: SCR_BaseVehicleInfo.c:5