Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
TestDragUserAction.c
Go to the documentation of this file.
1 // Script File
3 {
4  private SCR_InteractableBoxComponent m_BoxComponent = null;
5 
6  //------------------------------------------------------------------------------------------------
7  override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
8  {
9  if (!GetGame().GetWorldEntity())
10  return;
11 
12  GenericEntity genEnt = GenericEntity.Cast(pOwnerEntity);
13  m_BoxComponent = SCR_InteractableBoxComponent.Cast(genEnt.FindComponent(SCR_InteractableBoxComponent));
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
18  {
19  if (m_BoxComponent)
20  {
21  m_BoxComponent.PerformDragAction(pUserEntity);
22  return;
23  }
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  override bool GetActionNameScript(out string outName)
28  {
29  if (m_BoxComponent)
30  {
31  outName = m_BoxComponent.GetActionName();
32  return true;
33  }
34 
35  else
36  return false;
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  override bool CanBePerformedScript(IEntity user)
41  {
42  if (!m_BoxComponent)
43  return false;
44 
45  return m_BoxComponent.CanPerformDragAction();
46  }
47 
48 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
TestDragUserAction
Definition: TestDragUserAction.c:2
ScriptedUserAction
Definition: ScriptedUserAction.c:12
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_InteractableBoxComponent
void SCR_InteractableBoxComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: InteractableBoxComponent.c:253