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_InventoryNavigationButtonBack.c
Go to the documentation of this file.
1
2
3
//------------------------------------------------------------------------------------------------
4
class
SCR_InventoryNavigationButtonBack
:
SCR_InputButtonComponent
5
{
6
protected
bool
m_bCloseWithGamepad
;
7
protected
SCR_InventoryStorageBaseUI
m_pParentStorage
= null;
8
protected
int
m_iStorageIndex
= -1;
9
10
//------------------------------------------------------------------------------------------------
11
void
OnActivate
(
Widget
w)
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
25
m_OnActivated
.Invoke(
this
,
m_sActionName
,
m_pParentStorage
,
m_iStorageIndex
);
26
PlaySound
(
m_sSoundClicked
);
27
PlaySound
(
m_sSoundContainerClosed
);
28
return
false
;
29
}
30
31
//------------------------------------------------------------------------------------------------
32
override
protected
void
OnInput
()
33
{
34
if
(!
m_wRoot
)
35
return
;
36
37
if
(!
m_bCloseWithGamepad
)
38
return
;
39
40
bool
bEnabled =
m_wRoot
.IsEnabled();
41
bool
bVisible =
m_wRoot
.IsVisible();
42
43
if
(!bEnabled || !bVisible)
44
return
;
45
46
m_OnActivated
.Invoke(
this
,
m_sActionName
,
m_pParentStorage
,
m_iStorageIndex
);
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
//------------------------------------------------------------------------------------------------
69
void
SetParentStorage
(
SCR_InventoryStorageBaseUI
pParentStorage)
70
{
71
m_pParentStorage
= pParentStorage;
72
}
73
74
//------------------------------------------------------------------------------------------------
75
void
SetStorageIndex
(
int
index
)
76
{
77
m_iStorageIndex
=
index
;
78
}
79
80
//------------------------------------------------------------------------------------------------
81
void
EnableCloseWithGamepad
(
bool
enable)
82
{
83
m_bCloseWithGamepad
= enable;
84
}
85
86
//------------------------------------------------------------------------------------------------
87
int
GetStorageIndex
()
88
{
89
return
m_iStorageIndex
;
90
}
91
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:205
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
m_wRoot
Widget m_wRoot
Definition
SCR_GameModeCleanSweep.c:25
OnClick
void OnClick()
On click callback.
Definition
SCR_MapToolMenuUI.c:143
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_InputButtonComponent::m_OnActivated
ref ScriptInvoker m_OnActivated
Definition
SCR_InputButtonComponent.c:153
SCR_InputButtonComponent::m_sActionName
string m_sActionName
Definition
SCR_InputButtonComponent.c:11
SCR_InventoryNavigationButtonBack
Interactive non-focus button showing hint, and triggering actions.
Definition
SCR_InventoryNavigationButtonBack.c:5
SCR_InventoryNavigationButtonBack::OnInput
void OnInput()
Definition
SCR_InventoryNavigationButtonBack.c:32
SCR_InventoryNavigationButtonBack::m_bCloseWithGamepad
bool m_bCloseWithGamepad
Definition
SCR_InventoryNavigationButtonBack.c:6
SCR_InventoryNavigationButtonBack::OnActivate
void OnActivate(Widget w)
Definition
SCR_InventoryNavigationButtonBack.c:11
SCR_InventoryNavigationButtonBack::m_iStorageIndex
int m_iStorageIndex
Definition
SCR_InventoryNavigationButtonBack.c:8
SCR_InventoryNavigationButtonBack::m_pParentStorage
SCR_InventoryStorageBaseUI m_pParentStorage
Definition
SCR_InventoryNavigationButtonBack.c:7
SCR_InventoryNavigationButtonBack::SetAction
override bool SetAction(string action, EInputDeviceType currentInputDevice=-1, bool forceUpdate=false)
Definition
SCR_InventoryNavigationButtonBack.c:50
SCR_InventoryNavigationButtonBack::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
SCR_InventoryNavigationButtonBack.c:20
SCR_InventoryNavigationButtonBack::SetStorageIndex
void SetStorageIndex(int index)
Definition
SCR_InventoryNavigationButtonBack.c:75
SCR_InventoryNavigationButtonBack::OnMouseLeave
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Definition
SCR_InventoryNavigationButtonBack.c:59
SCR_InventoryNavigationButtonBack::SetParentStorage
void SetParentStorage(SCR_InventoryStorageBaseUI pParentStorage)
Definition
SCR_InventoryNavigationButtonBack.c:69
SCR_InventoryNavigationButtonBack::EnableCloseWithGamepad
void EnableCloseWithGamepad(bool enable)
Definition
SCR_InventoryNavigationButtonBack.c:81
SCR_InventoryNavigationButtonBack::GetStorageIndex
int GetStorageIndex()
Definition
SCR_InventoryNavigationButtonBack.c:87
SCR_InventoryStorageBaseUI
Definition
SCR_InventoryStorageBaseUI.c:7
SCR_WLibComponentBase::PlaySound
void PlaySound(string sound)
Definition
SCR_WLibComponentBase.c:123
SCR_WLibComponentBase::m_sSoundClicked
string m_sSoundClicked
Definition
SCR_WLibComponentBase.c:14
SCR_WLibComponentBase::m_sSoundContainerClosed
string m_sSoundContainerClosed
Definition
SCR_WLibComponentBase.c:17
Widget
Definition
Widget.c:13
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
UI
Components
SCR_InventoryNavigationButtonBack.c
Generated by
1.17.0