Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleSpeedCondition.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 {
6  [Attribute("3", UIWidgets.ComboBox, "Comparison operator", "", ParamEnumArray.FromEnum(SCR_ComparerOperator) )]
7  protected SCR_ComparerOperator m_eOperator;
8 
9  [Attribute("2", UIWidgets.EditBox, "Speed compare value\n[km/h]", "")]
10  protected float m_fValue;
11 
12  protected SignalsManagerComponent m_Signals;
13  protected int m_iSpeedID = -1;
14 
15  //------------------------------------------------------------------------------------------------
18  override bool IsAvailable(SCR_AvailableActionsConditionData data)
19  {
20  if (!data)
21  return false;
22 
23  SignalsManagerComponent signals = data.GetCurrentVehicleSignals();
24  if (!signals || m_Signals != signals)
25  {
26  m_Signals = signals;
27  m_iSpeedID = -1;
28  return false;
29  }
30 
31  if (m_iSpeedID == -1)
32  m_iSpeedID = signals.AddOrFindSignal("speed");
33 
34  int speed = 0;
35  if (m_iSpeedID != -1)
36  speed = signals.GetSignalValue(m_iSpeedID);
37 
38  bool result = false;
39 
40  result = SCR_Comparer<int>.Compare(m_eOperator, speed, (int)m_fValue);
41  return GetReturnResult(result);
42  }
43 };
SCR_AvailableActionsConditionData
Definition: SCR_AvailableActionsConditionData.c:5
SCR_AvailableActionCondition
A single available action condition representation.
Definition: SCR_AvailableActionsCondition.c:3
SCR_ComparerOperator
SCR_ComparerOperator
Definition: SCR_Comparer.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_VehicleSpeedCondition
Returns true if current vehicle speed matches the condition.
Definition: SCR_VehicleSpeedCondition.c:4
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468