Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_CompartmentUserAction.c
Go to the documentation of this file.
1
class
SCR_CompartmentUserAction
:
CompartmentUserAction
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
//------------------------------------------------------------------------------------------------
31
void
SetCompartmentDoorInfoIndex
(
int
index
)
32
{
33
m_iCompartmentDoorInfoIndex
=
index
;
34
}
35
36
//------------------------------------------------------------------------------------------------
37
int
GetCompartmentDoorInfoIndex
()
38
{
39
return
m_iCompartmentDoorInfoIndex
;
40
}
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
{
48
if
(
m_iCompartmentDoorInfoIndex
!= -1)
49
{
50
return
m_iCompartmentDoorInfoIndex
;
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
//------------------------------------------------------------------------------------------------
71
override
bool
HasLocalEffectOnlyScript
()
72
{
73
return
true
;
74
}
75
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
BaseUserAction::GetUIInfo
proto external UIInfo GetUIInfo()
Returns the UIInfo set for this user action or null if none.
CompartmentUserAction
Definition
CompartmentUserAction.c:13
IEntity
Definition
IEntity.c:13
InteractionHandlerComponent
Definition
InteractionHandlerComponent.c:11
SCR_CompartmentUserAction
Definition
SCR_CompartmentUserAction.c:2
SCR_CompartmentUserAction::GetRelevantDoorIndex
int GetRelevantDoorIndex(IEntity caller)
Definition
SCR_CompartmentUserAction.c:46
SCR_CompartmentUserAction::HasLocalEffectOnlyScript
override bool HasLocalEffectOnlyScript()
Definition
SCR_CompartmentUserAction.c:71
SCR_CompartmentUserAction::SetCompartmentDoorInfoIndex
void SetCompartmentDoorInfoIndex(int index)
Definition
SCR_CompartmentUserAction.c:31
SCR_CompartmentUserAction::m_iCompartmentDoorInfoIndex
int m_iCompartmentDoorInfoIndex
Definition
SCR_CompartmentUserAction.c:28
SCR_CompartmentUserAction::GetCompartmentDoorInfoIndex
int GetCompartmentDoorInfoIndex()
Definition
SCR_CompartmentUserAction.c:37
UIInfo
UIInfo - allows to define UI elements.
Definition
UIInfo.c:14
scripts
GameCode
UserAction
SCR_CompartmentUserAction.c
Generated by
1.17.0