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_ContextMenuActionsEditorUIComponent.c
Go to the documentation of this file.
1
class
SCR_ContextMenuActionsEditorUIComponent
:
SCR_BaseContextMenuEditorUIComponent
2
{
3
[
Attribute
(
SCR_SoundEvent
.FOCUS,
UIWidgets
.EditBox)]
4
protected
string
m_sSoundOnOpen
;
5
6
[
Attribute
(
SCR_SoundEvent
.SOUND_E_TRAN_CANCEL,
UIWidgets
.EditBox)]
7
protected
string
m_sSoundOnCancelClose
;
8
9
//~ Makes sure context action is never opened if not selection state
10
protected
bool
m_bEditorIsSelectingState
=
true
;
11
12
protected
SCR_EditableEntityComponent
m_HoveredEntityReference
;
13
14
//------------------------------------------------------------------------------------------------
15
protected
void
OnHoveredEntityCheck
(
float
tDelta)
16
{
17
if
(!
m_HoveredEntityReference
)
18
{
19
CloseContextMenu
();
20
GetMenu
().GetOnMenuUpdate().Remove(
OnHoveredEntityCheck
);
21
}
22
}
23
24
//------------------------------------------------------------------------------------------------
25
override
protected
void
PopulateContextMenu
(
vector
cursorWorldPosition)
26
{
27
super.PopulateContextMenu(cursorWorldPosition);
28
m_HoveredEntityReference
=
m_EditorActionsComponent
.GetHoveredEntity();
29
if
(
m_HoveredEntityReference
)
30
{
31
GetMenu
().GetOnMenuUpdate().Insert(
OnHoveredEntityCheck
);
32
33
//--- Close the menu when UI of hovered entity changed, as it implies major change in its state (e.g., character died)
34
if
(
m_HoveredEntityReference
.GetOnUIRefresh())
35
m_HoveredEntityReference
.GetOnUIRefresh().Insert(
CloseContextMenu
);
36
}
37
}
38
39
//------------------------------------------------------------------------------------------------
40
override
protected
void
OnEditorModeChanged
()
41
{
42
m_EditorActionsComponent
=
SCR_ContextActionsEditorComponent
.Cast(
SCR_ContextActionsEditorComponent
.GetInstance(
SCR_ContextActionsEditorComponent
));
43
}
44
45
//------------------------------------------------------------------------------------------------
46
protected
override
void
OpenContextMenu
()
47
{
48
super.OpenContextMenu();
49
50
if
(
m_ContextMenu
&&
m_ContextMenu
.IsVisible())
51
SCR_UISoundEntity
.SoundEvent(
m_sSoundOnOpen
);
52
}
53
54
//------------------------------------------------------------------------------------------------
55
override
void
CloseContextMenu
()
56
{
57
if
(
m_ContextMenu
&&
m_ContextMenu
.IsVisible())
58
GetGame
().GetCallqueue().CallLater(
DelayedCloseSound
, 100);
59
60
if
(
m_HoveredEntityReference
)
61
{
62
GetMenu
().GetOnMenuUpdate().Remove(
OnHoveredEntityCheck
);
63
m_HoveredEntityReference
= null;
64
}
65
66
super.CloseContextMenu();
67
}
68
69
//------------------------------------------------------------------------------------------------
70
protected
void
DelayedCloseSound
()
71
{
72
if
(!
IsContextMenuOpen
())
73
SCR_UISoundEntity
.SoundEvent(
m_sSoundOnCancelClose
);
74
}
75
76
//------------------------------------------------------------------------------------------------
77
protected
void
OnOpenActionsMenuUp
()
78
{
79
//~ Check if can open
80
if
(!
OnCancelUp
() ||
IsContextMenuOpen
() || !
m_bEditorIsSelectingState
)
81
{
82
//~ Reset the state
83
m_bEditorIsSelectingState
=
true
;
84
return
;
85
}
86
87
//~ Open
88
OpenContextMenu
();
89
}
90
91
//------------------------------------------------------------------------------------------------
92
protected
override
void
OnOpenActionsMenuDown
()
93
{
94
super.OnOpenActionsMenuDown();
95
96
//~ Is not selecting state so make sure on up context menu is not opened
97
SCR_StatesEditorComponent
statesManager =
SCR_StatesEditorComponent
.Cast(
SCR_StatesEditorComponent
.GetInstance(
SCR_StatesEditorComponent
));
98
if
(statesManager && statesManager.
GetState
() !=
EEditorState
.SELECTING)
99
m_bEditorIsSelectingState
=
false
;
100
}
101
102
//------------------------------------------------------------------------------------------------
103
override
void
HandlerAttachedScripted
(
Widget
w)
104
{
105
super.HandlerAttachedScripted(w);
106
107
if
(
m_InputManager
)
108
{
109
m_InputManager
.AddActionListener(
"EditorActionsMenu"
,
EActionTrigger
.DOWN,
OnOpenActionsMenuDown
);
110
m_InputManager
.AddActionListener(
"EditorActionsMenu"
,
EActionTrigger
.UP,
OnOpenActionsMenuUp
);
111
}
112
113
DiagMenu
.RegisterBool(
SCR_DebugMenuID
.DEBUGUI_EDITOR_ACTIONS_MENU_SHOWDISABLED,
string
.Empty,
"Show disabled actions"
,
"Actions Menu"
);
114
}
115
116
//------------------------------------------------------------------------------------------------
117
override
void
HandlerDeattached
(
Widget
w)
118
{
119
super.HandlerDeattached(w);
120
121
if
(
m_InputManager
)
122
{
123
m_InputManager
.RemoveActionListener(
"EditorActionsMenu"
,
EActionTrigger
.DOWN,
OnOpenActionsMenuDown
);
124
m_InputManager
.RemoveActionListener(
"EditorActionsMenu"
,
EActionTrigger
.UP,
OnOpenActionsMenuUp
);
125
}
126
127
DiagMenu
.Unregister(
SCR_DebugMenuID
.DEBUGUI_EDITOR_ACTIONS_MENU_SHOWDISABLED);
128
}
129
}
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition
DebugMenuID.c:4
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetMenu
SCR_RadialMenu GetMenu()
Definition
SCR_RadialMenuGameModeComponent.c:38
DiagMenu
Diagnostic and developer menu system.
Definition
DiagMenu.c:18
SCR_BaseContextMenuEditorUIComponent
Definition
SCR_BaseContextMenuEditorUIComponent.c:3
SCR_BaseContextMenuEditorUIComponent::m_InputManager
InputManager m_InputManager
Definition
SCR_BaseContextMenuEditorUIComponent.c:27
SCR_BaseContextMenuEditorUIComponent::m_ContextMenu
Widget m_ContextMenu
Definition
SCR_BaseContextMenuEditorUIComponent.c:30
SCR_BaseContextMenuEditorUIComponent::m_EditorActionsComponent
SCR_BaseActionsEditorComponent m_EditorActionsComponent
Definition
SCR_BaseContextMenuEditorUIComponent.c:39
SCR_BaseContextMenuEditorUIComponent::IsContextMenuOpen
bool IsContextMenuOpen()
Definition
SCR_BaseContextMenuEditorUIComponent.c:131
SCR_BaseEditorUIComponent::OnCancelUp
bool OnCancelUp()
Definition
SCR_BaseEditorUIComponent.c:34
SCR_ContextActionsEditorComponent
Definition
SCR_ContextActionsEditorComponent.c:16
SCR_ContextMenuActionsEditorUIComponent
Definition
SCR_ContextMenuActionsEditorUIComponent.c:2
SCR_ContextMenuActionsEditorUIComponent::HandlerAttachedScripted
override void HandlerAttachedScripted(Widget w)
Definition
SCR_ContextMenuActionsEditorUIComponent.c:103
SCR_ContextMenuActionsEditorUIComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_ContextMenuActionsEditorUIComponent.c:117
SCR_ContextMenuActionsEditorUIComponent::m_HoveredEntityReference
SCR_EditableEntityComponent m_HoveredEntityReference
Definition
SCR_ContextMenuActionsEditorUIComponent.c:12
SCR_ContextMenuActionsEditorUIComponent::m_bEditorIsSelectingState
bool m_bEditorIsSelectingState
Definition
SCR_ContextMenuActionsEditorUIComponent.c:10
SCR_ContextMenuActionsEditorUIComponent::OnOpenActionsMenuUp
void OnOpenActionsMenuUp()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:77
SCR_ContextMenuActionsEditorUIComponent::DelayedCloseSound
void DelayedCloseSound()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:70
SCR_ContextMenuActionsEditorUIComponent::OnEditorModeChanged
void OnEditorModeChanged()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:40
SCR_ContextMenuActionsEditorUIComponent::CloseContextMenu
override void CloseContextMenu()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:55
SCR_ContextMenuActionsEditorUIComponent::OnHoveredEntityCheck
void OnHoveredEntityCheck(float tDelta)
Definition
SCR_ContextMenuActionsEditorUIComponent.c:15
SCR_ContextMenuActionsEditorUIComponent::PopulateContextMenu
void PopulateContextMenu(vector cursorWorldPosition)
Definition
SCR_ContextMenuActionsEditorUIComponent.c:25
SCR_ContextMenuActionsEditorUIComponent::m_sSoundOnCancelClose
string m_sSoundOnCancelClose
Definition
SCR_ContextMenuActionsEditorUIComponent.c:7
SCR_ContextMenuActionsEditorUIComponent::OpenContextMenu
override void OpenContextMenu()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:46
SCR_ContextMenuActionsEditorUIComponent::OnOpenActionsMenuDown
override void OnOpenActionsMenuDown()
Definition
SCR_ContextMenuActionsEditorUIComponent.c:92
SCR_ContextMenuActionsEditorUIComponent::m_sSoundOnOpen
string m_sSoundOnOpen
Definition
SCR_ContextMenuActionsEditorUIComponent.c:4
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
SCR_StatesEditorComponent
Definition
SCR_StatesEditorComponent.c:10
SCR_StatesEditorComponent::GetState
EEditorState GetState()
Definition
SCR_StatesEditorComponent.c:33
SCR_UISoundEntity
Definition
SCR_UISoundEntity.c:8
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EEditorState
EEditorState
Unique editor state.
Definition
EEditorState.c:6
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
Editor
UI
Components
Common
SCR_ContextMenuActionsEditorUIComponent.c
Generated by
1.17.0