Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CompartmentUserAction.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override bool GetActionNameScript(out string outName)
5 {
6 BaseCompartmentSlot compartment = GetCompartmentSlot();
7 if (!compartment)
8 return false;
9
10 UIInfo compartmentInfo = compartment.GetUIInfo();
11 if (!compartmentInfo)
12 return false;
13
14 UIInfo actionInfo = GetUIInfo();
15 if (!actionInfo)
16 return false;
17
18 outName = actionInfo.GetName();
19 if (!compartmentInfo.GetName().IsEmpty())
20 outName += "%CTX_HACK%" + compartmentInfo.GetName();
21
22 return true;
23 }
24
25
28 protected int m_iCompartmentDoorInfoIndex = -1;
29
30 //------------------------------------------------------------------------------------------------
35
36 //------------------------------------------------------------------------------------------------
41
42 //------------------------------------------------------------------------------------------------
43 /* Performs door index search based on active player context, if relevant does not set
44 WARNING: Does not perform null checks for compartment and caller
45 */
46 protected int GetRelevantDoorIndex(IEntity caller)
47 {
49 {
51 }
52 PlayerController plC = GetGame().GetPlayerController();
53 if (!plC || plC.GetControlledEntity() != caller)
54 {
55 return -1;
56 }
57 auto interactionHandler = InteractionHandlerComponent.Cast(plC.FindComponent(InteractionHandlerComponent));
58 if (!interactionHandler)
59 {
60 return -1;
61 }
62 auto actionCtx = interactionHandler.GetCurrentContext();
63 if (actionCtx)
64 {
65 return GetCompartmentSlot().PickDoorIndexForPoint(actionCtx.GetOrigin());
66 }
67 return -1;
68 }
69
70 //------------------------------------------------------------------------------------------------
72 {
73 return true;
74 }
75};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
proto external UIInfo GetUIInfo()
Returns the UIInfo set for this user action or null if none.
UIInfo - allows to define UI elements.
Definition UIInfo.c:14