Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DoorUserAction.c
Go to the documentation of this file.
1
4{
5 //------------------------------------------------------------------------------------------------
6 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
7 {
8 BaseDoorComponent doorComponent = GetDoorComponent();
9 if (doorComponent)
10 {
11 doorComponent.UseDoorAction(pUserEntity);
12 }
13
14 super.PerformAction(pOwnerEntity, pUserEntity);
15 }
16
17 //------------------------------------------------------------------------------------------------
18 override bool CanBePerformedScript(IEntity user)
19 {
20 if (GetDoorComponent())
21 return true;
22
23 return false;
24 }
25
26 //------------------------------------------------------------------------------------------------
27 override bool GetActionNameScript(out string outName)
28 {
29 auto doorComponent = GetDoorComponent();
30 // Logic here is flipped since method returns the opposite of what we expect
31 if (doorComponent && Math.AbsFloat(doorComponent.GetControlValue()) >= 0.5)
32 outName = "#AR-UserAction_Close";
33 else
34 outName = "#AR-UserAction_Open";
35
36 return true;
37 }
38
39};
40
42{
43 // Kept only for compatibility reasons. It's the same as SCR_DoorUserAction
44};
Definition Math.c:13
@ PerformAction