Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_JumpOutUserAction.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
5 {
6 if (!pOwnerEntity)
7 return;
8
9 ChimeraCharacter character = ChimeraCharacter.Cast(pUserEntity);
10 if (!character)
11 return;
12
13 CharacterControllerComponent controller = character.GetCharacterController();
14 if (controller && controller.IsUnconscious())
15 return;
16
17 BaseCompartmentSlot targetCompartment = GetCompartmentSlot();
18 if (!targetCompartment)
19 return;
20
21 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
22 if (!compartmentAccess)
23 return;
24
25 if (!compartmentAccess.GetOutVehicle(EGetOutType.ANIMATED, GetRelevantDoorIndex(pUserEntity), ECloseDoorAfterActions.LEAVE_OPEN, false))
26 return;
27
28 super.PerformAction(pOwnerEntity, pUserEntity);
29 }
30
31 //------------------------------------------------------------------------------------------------
32 override bool CanBePerformedScript(IEntity user)
33 {
34 ChimeraCharacter character = ChimeraCharacter.Cast(user);
35 if (!character)
36 return false;
37
38 CharacterControllerComponent controller = character.GetCharacterController();
39 if (controller && controller.IsUnconscious())
40 return false;
41
42 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
43 if (!compartmentAccess)
44 return false;
45
46 if (!compartmentAccess.IsInCompartment())
47 return false;
48
49 if (compartmentAccess.IsGettingIn() || compartmentAccess.IsGettingOut())
50 return false;
51
52 BaseCompartmentSlot compartment = compartmentAccess.GetCompartment();
53 if (!compartment)
54 return false;
55
56 BaseCompartmentSlot thisCompartment = GetCompartmentSlot();
57 return thisCompartment == compartment;
58 }
59
60 //------------------------------------------------------------------------------------------------
61 override bool CanBeShownScript(IEntity user)
62 {
63 return CanBePerformed(user);
64 }
65
66 //------------------------------------------------------------------------------------------------
67 override bool GetActionNameScript(out string outName)
68 {
69 BaseCompartmentSlot compartment = GetCompartmentSlot();
70 if (!compartment)
71 return false;
72
73 UIInfo actionInfo = GetUIInfo();
74 if (!actionInfo)
75 return false;
76
77 outName = actionInfo.GetName();
78
79 return true;
80 }
81};
override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
UIInfo - allows to define UI elements.
Definition UIInfo.c:14
@ PerformAction
ECloseDoorAfterActions
EGetOutType
Definition EGetOutType.c:13