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_ScenarioFrameworkActionOnUserActionEvent.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerActionTitle
()]
2
class
SCR_ScenarioFrameworkActionOnUserActionEvent
:
SCR_ScenarioFrameworkActionBase
3
{
4
[
Attribute
(
desc
:
"Target entity that has the UserAction on it (Optional if action is attached on Slot that spawns target entity)"
)]
5
ref
SCR_ScenarioFrameworkGet
m_Getter;
6
7
[
Attribute
(
desc
:
"ID corresponding to the action attached on ActionsManagerComponent on target entity"
)]
8
int
m_iActionID;
9
10
[
Attribute
(
desc
:
"Only listen to changes when UserAction is activated by specific Entity (Optional - leave it empty to trigger by anyone)"
)]
11
ref
SCR_ScenarioFrameworkGet
m_GetterUser;
12
13
[
Attribute
(defvalue:
EUserActionEvent
.PerformAction.ToString(),
UIWidgets
.ComboBox,
"On which user action event this ScenarioFramework action will be triggered"
,
""
, ParamEnumArray.FromEnum(
EUserActionEvent
))]
14
EUserActionEvent
m_eUserActionEvent;
15
16
[
Attribute
(
desc
:
"Which actions will be executed once user action is used"
)]
17
ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
18
19
IEntity
m_ActionHolder;
20
ref array<IEntity> m_aUserEntities;
21
22
//------------------------------------------------------------------------------------------------
23
void
OnInvoked(
IEntity
user,
ScriptedUserAction
action,
EUserActionEvent
e)
24
{
25
if
(e != m_eUserActionEvent)
26
return
;
27
28
if
(m_aUserEntities && !m_aUserEntities.IsEmpty() && !m_aUserEntities.Contains(user))
29
return
;
30
31
foreach
(
SCR_ScenarioFrameworkActionBase
actions : m_aActions)
32
{
33
actions.OnActivate(m_Entity);
34
}
35
36
BaseActionsManagerComponent
actionsManager = action.
GetActionsManager
();
37
if
(actionsManager)
38
actionsManager.RemoveUserActionEventListener(action, OnInvoked);
39
}
40
41
//------------------------------------------------------------------------------------------------
42
override
void
OnActivate
(
IEntity
object
)
43
{
44
if
(!CanActivate())
45
return
;
46
47
IEntity
entity;
48
if
(!ValidateInputEntity(
object
, m_Getter, entity))
49
return
;
50
51
BaseActionsManagerComponent
actionsManager =
BaseActionsManagerComponent
.Cast(entity.
FindComponent
(
BaseActionsManagerComponent
));
52
if
(!actionsManager)
53
return
;
54
55
BaseUserAction
userAction = actionsManager.FindAction(m_iActionID);
56
if
(!userAction)
57
return
;
58
59
ScriptedUserAction
scriptedUserAction =
ScriptedUserAction
.Cast(userAction);
60
if
(!scriptedUserAction)
61
return
;
62
63
if
(m_GetterUser)
64
{
65
SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_GetterUser.Get());
66
if
(entityWrapper)
67
{
68
m_aUserEntities = {};
69
entity = entityWrapper.GetValue();
70
if
(entity)
71
m_aUserEntities.Insert(entity);
72
}
73
else
74
{
75
SCR_ScenarioFrameworkParam<array<IEntity>> arrayOfEntitiesWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_GetterUser.Get());
76
if
(arrayOfEntitiesWrapper)
77
{
78
m_aUserEntities = {};
79
m_aUserEntities.InsertAll(arrayOfEntitiesWrapper.GetValue());
80
}
81
}
82
}
83
84
m_ActionHolder = entity;
85
actionsManager.AddUserActionEventListener(scriptedUserAction, OnInvoked);
86
}
87
88
//------------------------------------------------------------------------------------------------
89
override
array<ref SCR_ScenarioFrameworkActionBase> GetSubActions()
90
{
91
return
m_aActions;
92
}
93
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseActionsManagerComponent
Definition
BaseActionsManagerComponent.c:13
BaseUserAction
Definition
BaseUserAction.c:13
BaseUserAction::GetActionsManager
proto external ActionsManagerComponent GetActionsManager()
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_ContainerActionTitle
Definition
SCR_ContainerActionTitle.c:2
SCR_ScenarioFrameworkActionBase
Definition
SCR_ScenarioFrameworkActionBase.c:3
SCR_ScenarioFrameworkActionOnUserActionEvent
Definition
SCR_ScenarioFrameworkActionOnUserActionEvent.c:3
SCR_ScenarioFrameworkGet
Definition
SCR_ScenarioFrameworkGet.c:3
ScriptedUserAction
Definition
ScriptedUserAction.c:13
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EUserActionEvent
EUserActionEvent
Definition
EUserActionEvent.c:13
scripts
Game
ScenarioFramework
Actions
SCR_ScenarioFrameworkActionOnUserActionEvent.c
Generated by
1.17.0