Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DetonatorAction.c
Go to the documentation of this file.
2{
3 SCR_DetonatorGadgetComponent m_DetonatorComp;
4 SCR_BaseDeployableInventoryItemComponent m_DeployableInvItemComp;
5
6 //------------------------------------------------------------------------------------------------
7 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
8 {
9 m_DetonatorComp = SCR_DetonatorGadgetComponent.Cast(pOwnerEntity.FindComponent(SCR_DetonatorGadgetComponent));
11 }
12
13 //------------------------------------------------------------------------------------------------
14 override bool CanBeShownScript(IEntity user)
15 {
16 if (!m_DetonatorComp)
17 return false;
18
20 if (!character)
21 return false;
22
23 CharacterControllerComponent characterControllerComp = character.GetCharacterController();
24 if (!characterControllerComp)
25 return false;
26
27 if (!characterControllerComp.GetInspect())
28 if (!m_DeployableInvItemComp || !m_DeployableInvItemComp.IsDeployed())
29 return false;
30
31 return true;
32 }
33
34 //------------------------------------------------------------------------------------------------
35 override bool CanBePerformedScript(IEntity user)
36 {
37 if (!m_DetonatorComp)
38 return false;
39
40 if (!m_DetonatorComp.GetNumberOfConnectedCharges())
41 {
42 UIInfo actionInfo = GetUIInfo();
43 if (actionInfo)
44 SetCannotPerformReason(actionInfo.GetDescription());
45
46 return false;
47 }
48
49 return true;
50 }
51
52 //------------------------------------------------------------------------------------------------
53 override bool GetActionNameScript(out string outName)
54 {
55 UIInfo actionInfo = GetUIInfo();
56 if (!actionInfo)
57 return false;
58
59 outName = actionInfo.GetName();
60
61 return true;
62 }
63
64 //------------------------------------------------------------------------------------------------
65 override bool HasLocalEffectOnlyScript()
66 {
67 return false;
68 }
69
70 //------------------------------------------------------------------------------------------------
71 override bool CanBroadcastScript()
72 {
73 return true;
74 }
75}
override void Init()
override bool CanBroadcastScript()
override bool HasLocalEffectOnlyScript()
void SetCannotPerformReason(string reason)
proto external UIInfo GetUIInfo()
Returns the UIInfo set for this user action or null if none.
proto external Managed FindComponent(typename typeName)
Base class which all deployable inventory items inherit from.
A scripted action class having optional logic to check if vehicle is valid.
UIInfo - allows to define UI elements.
Definition UIInfo.c:14