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_ButtonHintEditorUIComponent.c
Go to the documentation of this file.
1
class
SCR_ButtonHintEditorUIComponent
:
MenuRootSubComponent
2
{
3
//---- REFACTOR NOTE START: Conditions might be using more generic behavior?
4
5
protected
const
int
CONDITION_DEVICE
= 1;
6
protected
const
int
CONDITION_FOCUS
= 2;
7
8
protected
int
m_Show
;
9
10
//------------------------------------------------------------------------------------------------
11
protected
void
RefreshVisibility
()
12
{
13
bool
show =
m_Show
== (
CONDITION_DEVICE
|
CONDITION_FOCUS
);
14
15
GetWidget
().SetEnabled(show);
16
GetWidget
().SetVisible(show);
17
}
18
19
//------------------------------------------------------------------------------------------------
20
protected
void
OnMenuFocusGained
()
21
{
22
m_Show
|=
CONDITION_FOCUS
;
23
24
RefreshVisibility
();
25
}
26
27
//------------------------------------------------------------------------------------------------
28
protected
void
OnMenuFocusLost
()
29
{
30
m_Show
&=
~CONDITION_FOCUS
;
31
32
RefreshVisibility
();
33
}
34
35
//------------------------------------------------------------------------------------------------
36
protected
void
OnInputDeviceIsGamepad
(
bool
isGamepad)
37
{
38
if
(isGamepad)
39
m_Show
|=
CONDITION_DEVICE
;
40
else
41
m_Show
&=
~CONDITION_DEVICE
;
42
43
RefreshVisibility
();
44
}
45
46
//---- REFACTOR NOTE END ----
47
48
//------------------------------------------------------------------------------------------------
49
override
protected
bool
IsUnique
()
50
{
51
return
false
;
52
}
53
54
//------------------------------------------------------------------------------------------------
55
override
void
HandlerAttachedScripted
(
Widget
w)
56
{
57
MenuRootBase
menu =
GetMenu
();
58
if
(!menu)
59
return
;
60
61
menu.
GetOnMenuFocusGained
().Insert(
OnMenuFocusGained
);
62
menu.
GetOnMenuFocusLost
().Insert(
OnMenuFocusLost
);
63
64
GetGame
().OnInputDeviceIsGamepadInvoker().Insert(
OnInputDeviceIsGamepad
);
65
66
OnMenuFocusGained
();
67
OnInputDeviceIsGamepad
(!
GetGame
().
GetInputManager
().IsUsingMouseAndKeyboard());
68
}
69
70
//------------------------------------------------------------------------------------------------
71
override
void
HandlerDeattached
(
Widget
w)
72
{
73
MenuRootBase
menu =
GetMenu
();
74
if
(!menu)
75
return
;
76
77
menu.
GetOnMenuFocusGained
().Remove(
OnMenuFocusGained
);
78
menu.
GetOnMenuFocusLost
().Remove(
OnMenuFocusLost
);
79
80
GetGame
().OnInputDeviceIsGamepadInvoker().Remove(
OnInputDeviceIsGamepad
);
81
}
82
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:205
GetMenu
SCR_RadialMenu GetMenu()
Definition
SCR_RadialMenuGameModeComponent.c:38
GetWidget
Widget GetWidget()
Definition
SCR_VonDisplay.c:162
MenuRootBase
Definition
MenuRootBase.c:11
MenuRootBase::GetOnMenuFocusGained
ScriptInvoker GetOnMenuFocusGained()
Definition
MenuRootBase.c:42
MenuRootBase::GetOnMenuFocusLost
ScriptInvoker GetOnMenuFocusLost()
Definition
MenuRootBase.c:48
MenuRootSubComponent
Definition
MenuRootSubComponent.c:6
SCR_ButtonHintEditorUIComponent
Definition
SCR_ButtonHintEditorUIComponent.c:2
SCR_ButtonHintEditorUIComponent::CONDITION_DEVICE
const int CONDITION_DEVICE
Definition
SCR_ButtonHintEditorUIComponent.c:5
SCR_ButtonHintEditorUIComponent::RefreshVisibility
void RefreshVisibility()
Definition
SCR_ButtonHintEditorUIComponent.c:11
SCR_ButtonHintEditorUIComponent::m_Show
int m_Show
Definition
SCR_ButtonHintEditorUIComponent.c:8
SCR_ButtonHintEditorUIComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_ButtonHintEditorUIComponent.c:71
SCR_ButtonHintEditorUIComponent::OnMenuFocusLost
void OnMenuFocusLost()
Definition
SCR_ButtonHintEditorUIComponent.c:28
SCR_ButtonHintEditorUIComponent::OnMenuFocusGained
void OnMenuFocusGained()
Definition
SCR_ButtonHintEditorUIComponent.c:20
SCR_ButtonHintEditorUIComponent::OnInputDeviceIsGamepad
void OnInputDeviceIsGamepad(bool isGamepad)
Definition
SCR_ButtonHintEditorUIComponent.c:36
SCR_ButtonHintEditorUIComponent::HandlerAttachedScripted
override void HandlerAttachedScripted(Widget w)
Definition
SCR_ButtonHintEditorUIComponent.c:55
SCR_ButtonHintEditorUIComponent::IsUnique
bool IsUnique()
Definition
SCR_ButtonHintEditorUIComponent.c:49
SCR_ButtonHintEditorUIComponent::CONDITION_FOCUS
const int CONDITION_FOCUS
Definition
SCR_ButtonHintEditorUIComponent.c:6
Widget
Definition
Widget.c:13
scripts
Game
Editor
UI
Components
Common
SCR_ButtonHintEditorUIComponent.c
Generated by
1.17.0