Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_InventoryNavigationButtonBack.c
Go to the documentation of this file.
1
2
3//------------------------------------------------------------------------------------------------
5{
6 protected bool m_bCloseWithGamepad;
8 protected int m_iStorageIndex = -1;
9
10 //------------------------------------------------------------------------------------------------
12 {
13 if (GetGame().GetInputManager().GetLastUsedInputDevice() == EInputDeviceType.MOUSE)
14 return;
15
16 OnClick(w, 0, 0, 0);
17 }
18
19 //------------------------------------------------------------------------------------------------
20 override bool OnClick(Widget w, int x, int y, int button)
21 {
22 if (button != 0 || !m_wRoot.IsVisible() || !m_wRoot.IsEnabled())
23 return false;
24
28 return false;
29 }
30
31 //------------------------------------------------------------------------------------------------
32 override protected void OnInput()
33 {
34 if (!m_wRoot)
35 return;
36
38 return;
39
40 bool bEnabled = m_wRoot.IsEnabled();
41 bool bVisible = m_wRoot.IsVisible();
42
43 if (!bEnabled || !bVisible)
44 return;
45
47 }
48
49 //------------------------------------------------------------------------------------------------
50 override bool SetAction(string action, EInputDeviceType currentInputDevice = -1, bool forceUpdate = false)
51 {
52 // Remove old listener and add a new one
53 GetGame().GetInputManager().RemoveActionListener(m_sActionName, EActionTrigger.DOWN, OnInput);
54 GetGame().GetInputManager().AddActionListener(m_sActionName, EActionTrigger.DOWN, OnInput);
55 return true;
56 }
57
58 //------------------------------------------------------------------------------------------------
59 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
60 {
61 super.OnMouseLeave(w, enterW, x, y);
62
63 GetGame().GetWorkspace().SetFocusedWidget(null);
64
65 return false;
66 }
67
68 //------------------------------------------------------------------------------------------------
70 {
71 m_pParentStorage = pParentStorage;
72 }
73
74 //------------------------------------------------------------------------------------------------
76 {
78 }
79
80 //------------------------------------------------------------------------------------------------
81 void EnableCloseWithGamepad(bool enable)
82 {
83 m_bCloseWithGamepad = enable;
84 }
85
86 //------------------------------------------------------------------------------------------------
88 {
89 return m_iStorageIndex;
90 }
91};
ArmaReforgerScripted GetGame()
Definition game.c:1398
InputManager GetInputManager()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Widget m_wRoot
void OnClick()
On click callback.
Interactive non-focus button showing hint, and triggering actions.
override bool SetAction(string action, EInputDeviceType currentInputDevice=-1, bool forceUpdate=false)
override bool OnClick(Widget w, int x, int y, int button)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
void SetParentStorage(SCR_InventoryStorageBaseUI pParentStorage)
EActionTrigger