Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ReplaceWheelUserAction.c
Go to the documentation of this file.
2 {
3  [Attribute("0", UIWidgets.Auto, "The index of the tire this action should be activated on", category: "")]
4  protected int m_iTireIndex;
5 
6  #ifdef ENABLE_DESTRUCTION
7  protected SCR_TireReplacementManagerComponent m_ReplacementManager;
8 
9  //------------------------------------------------------------------------------------------------
10  override bool CanBeShownScript(IEntity user)
11  {
12  if(!m_ReplacementManager)
13  return false;
14 
15  return m_ReplacementManager.CanTireBeReplaced(m_iTireIndex);
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override bool CanBePerformedScript(IEntity user)
20  {
21  if(!m_ReplacementManager)
22  return false;
23 
24  //TODO: notify user somehow when area is not clear
25  return m_ReplacementManager.IsWheelAreaClear(m_iTireIndex, user);
26  }
27 
28  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
29  {
30  if(!m_ReplacementManager)
31  return;
32 
33  m_ReplacementManager.InitReplace(m_iTireIndex);
34  }
35 
36  //------------------------------------------------------------------------------------------------
37  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
38  {
39  GenericEntity ownerEntity = GenericEntity.Cast(pOwnerEntity);
40  m_ReplacementManager = SCR_TireReplacementManagerComponent.Cast(ownerEntity.FindComponent(SCR_TireReplacementManagerComponent));
41  }
42  #endif
43 };
CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition: SCR_LoiterUserAction.c:64
ScriptedUserAction
Definition: ScriptedUserAction.c:12
SCR_ReplaceWheelUserAction
Definition: SCR_ReplaceWheelUserAction.c:1
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
Init
void Init(IEntity entity=null, vector worldPos=vector.Zero, float timestamp=0.0, EAITargetInfoCategory category=0)
Definition: SCR_AITargetInfo.c:27
CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition: SCR_LoiterUserAction.c:70
Attribute
typedef Attribute
Post-process effect of scripted camera.
PerformAction
proto external void PerformAction(BaseUserAction action)
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180