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_CommandActionsEditorUIComponent.c
Go to the documentation of this file.
1
class
SCR_CommandActionsEditorUIComponent
:
SCR_BaseContextMenuEditorUIComponent
2
{
3
[
Attribute
(
"EditorSetCommand"
)]
4
protected
string
m_sSetCommandAction
;
5
6
[
Attribute
(
"EditorAddCommand"
)]
7
protected
string
m_sAddCommandAction
;
8
9
protected
SCR_CommandActionsEditorComponent
m_CommandActionsComponent
;
10
protected
SCR_BaseEditableEntityFilter
m_Filter
;
11
protected
EEditorCommandActionFlags
m_State
;
12
13
protected
ref
ScriptInvoker
Event_OnCommandStateChange
=
new
ScriptInvoker
();
14
15
//------------------------------------------------------------------------------------------------
18
EEditorCommandActionFlags
GetCommandState
()
19
{
20
return
m_State
;
21
}
22
23
//------------------------------------------------------------------------------------------------
26
ScriptInvoker
GetOnCommandStateChange
()
27
{
28
return
Event_OnCommandStateChange
;
29
}
30
31
//------------------------------------------------------------------------------------------------
32
protected
void
PerformDefaultCommand
(
bool
isQueue)
33
{
34
OnOpenActionsMenuDown
();
35
if
(!
OnCancelUp
() ||
IsContextMenuOpen
())
36
return
;
37
38
m_CommandActionsComponent
.PerformDefaultAction(isQueue);
39
}
40
41
//------------------------------------------------------------------------------------------------
42
protected
void
OnEditorSetCommand
()
43
{
44
PerformDefaultCommand
(
false
);
45
}
46
47
//------------------------------------------------------------------------------------------------
48
protected
void
OnEditorAddCommand
()
49
{
50
PerformDefaultCommand
(
true
);
51
}
52
53
//------------------------------------------------------------------------------------------------
54
protected
void
OnEditorCommandModifier
(
float
value,
EActionTrigger
reason
)
55
{
56
if
(
reason
==
EActionTrigger
.DOWN)
57
{
58
UpdateState
();
59
m_Filter
.GetOnChanged().Insert(
OnSelectedChanged
);
60
}
61
else
62
{
63
UpdateState
(
true
);
64
m_Filter
.GetOnChanged().Remove(
OnSelectedChanged
);
65
}
66
}
67
68
//------------------------------------------------------------------------------------------------
69
protected
void
OnSelectedChanged
(
EEditableEntityState
state, set<SCR_EditableEntityComponent> entitiesInsert, set<SCR_EditableEntityComponent> entitiesRemove)
70
{
71
UpdateState
();
72
}
73
74
//------------------------------------------------------------------------------------------------
75
protected
void
UpdateState
(
bool
clear =
false
)
76
{
77
78
if
(clear)
79
m_State
= 0;
80
else
81
m_State
=
m_CommandActionsComponent
.ValidateSelection(
false
);
82
83
Event_OnCommandStateChange
.Invoke(
m_State
);
84
}
85
86
//------------------------------------------------------------------------------------------------
87
private
void
OnMenuUpdate
(
float
tDelta)
88
{
89
m_InputManager
.ActivateContext(
"EditorCommandContext"
);
90
//m_InputManager.ActivateContext("EditorCommandActionsContext");
91
//m_InputManager.SetContextDebug("EditorCommandActionsContext", true);
92
}
93
94
//------------------------------------------------------------------------------------------------
95
override
void
HandlerAttachedScripted(Widget w)
96
{
97
super.HandlerAttachedScripted(w);
98
99
m_CommandActionsComponent
= SCR_CommandActionsEditorComponent.Cast(SCR_CommandActionsEditorComponent.GetInstance(SCR_CommandActionsEditorComponent,
true
));
100
m_EditorActionsComponent
=
m_CommandActionsComponent
;
101
if
(!
m_CommandActionsComponent
)
102
return
;
103
104
if
(
m_InputManager
)
105
{
106
m_InputManager
.AddActionListener(
m_sSetCommandAction
,
EActionTrigger
.DOWN,
OnEditorSetCommand
);
107
m_InputManager
.AddActionListener(
m_sAddCommandAction
,
EActionTrigger
.DOWN,
OnEditorAddCommand
);
108
109
m_InputManager
.AddActionListener(
"EditorCommandModifier"
,
EActionTrigger
.DOWN,
OnEditorCommandModifier
);
110
m_InputManager
.AddActionListener(
"EditorCommandModifier"
,
EActionTrigger
.UP,
OnEditorCommandModifier
);
111
}
112
113
m_Filter
= SCR_BaseEditableEntityFilter.GetInstance(
EEditableEntityState
.COMMANDED,
true
);
//--- ToDo: Don't hardcode
114
115
MenuRootBase menu =
GetMenu
();
116
if
(!menu)
117
return
;
118
119
menu.
GetOnMenuUpdate
().Insert(OnMenuUpdate);
120
}
121
122
//------------------------------------------------------------------------------------------------
123
override
void
HandlerDeattached(Widget w)
124
{
125
super.HandlerDeattached(w);
126
127
if
(
m_InputManager
)
128
{
129
m_InputManager
.RemoveActionListener(
m_sSetCommandAction
,
EActionTrigger
.DOWN,
OnEditorSetCommand
);
130
m_InputManager
.RemoveActionListener(
m_sAddCommandAction
,
EActionTrigger
.DOWN,
OnEditorAddCommand
);
131
132
m_InputManager
.RemoveActionListener(
"EditorCommandModifier"
,
EActionTrigger
.DOWN,
OnEditorCommandModifier
);
133
m_InputManager
.RemoveActionListener(
"EditorCommandModifier"
,
EActionTrigger
.UP,
OnEditorCommandModifier
);
134
}
135
136
if
(
m_Filter
)
137
m_Filter
.GetOnChanged().Remove(
OnSelectedChanged
);
138
139
MenuRootBase menu =
GetMenu
();
140
if
(!menu)
141
return
;
142
143
menu.
GetOnMenuUpdate
().Remove(OnMenuUpdate);
144
}
145
}
m_InputManager
InputManager m_InputManager
Definition
SCR_BaseManualCameraComponent.c:155
OnMenuUpdate
void OnMenuUpdate(float tDelta)
Definition
SCR_CursorEditorUIComponent.c:423
GetMenu
SCR_RadialMenu GetMenu()
Definition
SCR_RadialMenuGameModeComponent.c:38
reason
string reason
Definition
ServerBrowserMenuCallbacks.c:41
MenuRootBase::GetOnMenuUpdate
ScriptInvoker GetOnMenuUpdate()
Definition
MenuRootBase.c:72
SCR_BaseContextMenuEditorUIComponent
Definition
SCR_BaseContextMenuEditorUIComponent.c:3
SCR_BaseContextMenuEditorUIComponent::m_InputManager
InputManager m_InputManager
Definition
SCR_BaseContextMenuEditorUIComponent.c:27
SCR_BaseContextMenuEditorUIComponent::OnOpenActionsMenuDown
void OnOpenActionsMenuDown()
Definition
SCR_BaseContextMenuEditorUIComponent.c:233
SCR_BaseContextMenuEditorUIComponent::m_EditorActionsComponent
SCR_BaseActionsEditorComponent m_EditorActionsComponent
Definition
SCR_BaseContextMenuEditorUIComponent.c:39
SCR_BaseContextMenuEditorUIComponent::IsContextMenuOpen
bool IsContextMenuOpen()
Definition
SCR_BaseContextMenuEditorUIComponent.c:131
SCR_BaseEditableEntityFilter
Definition
SCR_BaseEditableEntityFilter.c:14
SCR_BaseEditorUIComponent::OnCancelUp
bool OnCancelUp()
Definition
SCR_BaseEditorUIComponent.c:34
SCR_CommandActionsEditorComponent
Definition
SCR_CommandActionsEditorComponent.c:11
SCR_CommandActionsEditorUIComponent
Definition
SCR_CommandActionsEditorUIComponent.c:2
SCR_CommandActionsEditorUIComponent::GetCommandState
EEditorCommandActionFlags GetCommandState()
Definition
SCR_CommandActionsEditorUIComponent.c:18
SCR_CommandActionsEditorUIComponent::m_State
EEditorCommandActionFlags m_State
Definition
SCR_CommandActionsEditorUIComponent.c:11
SCR_CommandActionsEditorUIComponent::OnEditorAddCommand
void OnEditorAddCommand()
Definition
SCR_CommandActionsEditorUIComponent.c:48
SCR_CommandActionsEditorUIComponent::OnEditorCommandModifier
void OnEditorCommandModifier(float value, EActionTrigger reason)
Definition
SCR_CommandActionsEditorUIComponent.c:54
SCR_CommandActionsEditorUIComponent::m_sAddCommandAction
string m_sAddCommandAction
Definition
SCR_CommandActionsEditorUIComponent.c:7
SCR_CommandActionsEditorUIComponent::Event_OnCommandStateChange
ref ScriptInvoker Event_OnCommandStateChange
Definition
SCR_CommandActionsEditorUIComponent.c:13
SCR_CommandActionsEditorUIComponent::PerformDefaultCommand
void PerformDefaultCommand(bool isQueue)
Definition
SCR_CommandActionsEditorUIComponent.c:32
SCR_CommandActionsEditorUIComponent::OnEditorSetCommand
void OnEditorSetCommand()
Definition
SCR_CommandActionsEditorUIComponent.c:42
SCR_CommandActionsEditorUIComponent::OnSelectedChanged
void OnSelectedChanged(EEditableEntityState state, set< SCR_EditableEntityComponent > entitiesInsert, set< SCR_EditableEntityComponent > entitiesRemove)
Definition
SCR_CommandActionsEditorUIComponent.c:69
SCR_CommandActionsEditorUIComponent::m_sSetCommandAction
string m_sSetCommandAction
Definition
SCR_CommandActionsEditorUIComponent.c:4
SCR_CommandActionsEditorUIComponent::GetOnCommandStateChange
ScriptInvoker GetOnCommandStateChange()
Definition
SCR_CommandActionsEditorUIComponent.c:26
SCR_CommandActionsEditorUIComponent::m_CommandActionsComponent
SCR_CommandActionsEditorComponent m_CommandActionsComponent
Definition
SCR_CommandActionsEditorUIComponent.c:9
SCR_CommandActionsEditorUIComponent::UpdateState
void UpdateState(bool clear=false)
Definition
SCR_CommandActionsEditorUIComponent.c:75
SCR_CommandActionsEditorUIComponent::m_Filter
SCR_BaseEditableEntityFilter m_Filter
Definition
SCR_CommandActionsEditorUIComponent.c:10
EEditableEntityState
EEditableEntityState
Definition
EEditableEntityState.c:38
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EEditorCommandActionFlags
EEditorCommandActionFlags
Simplified action conditions.
Definition
EEditorCommandActionFlags.c:6
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
Editor
UI
Components
Common
SCR_CommandActionsEditorUIComponent.c
Generated by
1.17.0