Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleAction.c
Go to the documentation of this file.
2 {
4  [Attribute( uiwidget: UIWidgets.EditBox, desc: "Signal name")]
5  private string m_sSignalName;
6  private int m_iSignalIndex = -1;
7 
9  private SignalsManagerComponent m_SignalsManager;
10 
12  override bool CanBePerformedScript(IEntity user)
13  {
14  if (!m_SignalsManager) // Do nothing if there is no signal manager
15  return false;
16 
17  if (m_iSignalIndex < 0)
18  return false;
19 
20  return true;
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
25  {
26  m_SignalsManager = SignalsManagerComponent.Cast(pOwnerEntity.FindComponent(SignalsManagerComponent));
27  if (m_SignalsManager)
28  m_iSignalIndex = m_SignalsManager.AddOrFindMPSignal(m_sSignalName, 0.5, 1, 0, SignalCompressionFunc.Range01);
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override bool GetState()
33  {
34  return m_SignalsManager && m_SignalsManager.GetSignalValue(m_iSignalIndex) > 0.5;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override void SetState(bool enable)
39  {
40  if (!m_SignalsManager)
41  return;
42 
43  float targetValue = 0;
44  if (enable)
45  targetValue = 1;
46 
47  m_SignalsManager.SetSignalValue(m_iSignalIndex, targetValue);
48  }
49 };
SCR_VehicleActionBase
Definition: SCR_VehicleActionBase.c:1
m_SignalsManager
protected SignalsManagerComponent m_SignalsManager
Definition: SCR_VehicleDamageManagerComponent.c:208
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SignalCompressionFunc
SignalCompressionFunc
Definition: SignalCompressionFunc.c:7
SCR_VehicleAction
Definition: SCR_VehicleAction.c:1