Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ButtonHintEditorUIComponent.c
Go to the documentation of this file.
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 {
23
25 }
26
27 //------------------------------------------------------------------------------------------------
28 protected void OnMenuFocusLost()
29 {
31
33 }
34
35 //------------------------------------------------------------------------------------------------
36 protected void OnInputDeviceIsGamepad(bool isGamepad)
37 {
38 if (isGamepad)
40 else
42
44 }
45
46 //---- REFACTOR NOTE END ----
47
48 //------------------------------------------------------------------------------------------------
49 override protected bool IsUnique()
50 {
51 return false;
52 }
53
54 //------------------------------------------------------------------------------------------------
56 {
57 MenuRootBase menu = GetMenu();
58 if (!menu)
59 return;
60
63
64 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
65
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
79
80 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
81 }
82}
ArmaReforgerScripted GetGame()
Definition game.c:1398
InputManager GetInputManager()
SCR_RadialMenu GetMenu()
Widget GetWidget()
ScriptInvoker GetOnMenuFocusGained()
ScriptInvoker GetOnMenuFocusLost()