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_ButtonListComponent.c
Go to the documentation of this file.
1
/*
2
Component for handling button specific list view
3
*/
4
5
//------------------------------------------------------------------------------------------------
6
class
SCR_ButtonListViewComponent
:
SCR_ListViewComponent
7
{
8
protected
ref array<SCR_ButtonComponent>
m_aButtons
=
new
array<SCR_ButtonComponent>;
9
10
ref
ScriptInvoker
m_OnEntryFocus
=
new
ScriptInvoker
;
11
12
//-------------------------------------
13
// List component override
14
//-------------------------------------
15
16
//------------------------------------------------------------------------------------------------
17
override
void
HandlerAttached
(
Widget
w)
18
{
19
super.HandlerAttached(w);
20
}
21
22
//------------------------------------------------------------------------------------------------
24
override
protected
void
SetupEntryBehavior
(
Widget
entry)
25
{
26
// Entry check
27
if
(!entry)
28
return
;
29
30
// Find server entry component
31
SCR_ButtonComponent
button =
SCR_ButtonComponent
.Cast(entry.FindHandler(
SCR_ButtonComponent
));
32
if
(!button)
33
return
;
34
35
// Invokers
36
button.m_OnFocus.Insert(
OnEntryFocus
);
37
38
// Insert to list
39
m_aButtons
.Insert(button);
40
}
41
42
//-------------------------------------
43
// Invoker actions
44
//-------------------------------------
45
46
//------------------------------------------------------------------------------------------------
48
protected
void
OnEntryFocus
(
Widget
w)
49
{
50
m_OnEntryFocus
.Invoke();
51
52
m_iFocusedEntryId
=
m_aEntryWidgets
.Find(w) +
Math
.Floor(
m_fScrollPosition
);
53
}
54
55
//-------------------------------------
56
// Get & Set
57
//-------------------------------------
58
59
//------------------------------------------------------------------------------------------------
60
array<SCR_ButtonComponent>
GetButtons
() {
return
m_aButtons
; }
61
};
Math
Definition
Math.c:13
SCR_ButtonComponent
Deprecated button component. Still used in many prefabs, so it works, it's just stripped of most of t...
Definition
SCR_ButtonComponent.c:5
SCR_ButtonListViewComponent
Definition
SCR_ButtonListComponent.c:7
SCR_ButtonListViewComponent::GetButtons
array< SCR_ButtonComponent > GetButtons()
Definition
SCR_ButtonListComponent.c:60
SCR_ButtonListViewComponent::OnEntryFocus
void OnEntryFocus(Widget w)
Call this when entry in list is focused.
Definition
SCR_ButtonListComponent.c:48
SCR_ButtonListViewComponent::m_OnEntryFocus
ref ScriptInvoker m_OnEntryFocus
Definition
SCR_ButtonListComponent.c:10
SCR_ButtonListViewComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ButtonListComponent.c:17
SCR_ButtonListViewComponent::m_aButtons
ref array< SCR_ButtonComponent > m_aButtons
Definition
SCR_ButtonListComponent.c:8
SCR_ButtonListViewComponent::SetupEntryBehavior
void SetupEntryBehavior(Widget entry)
Setup server entry component behavior.
Definition
SCR_ButtonListComponent.c:24
SCR_ListViewComponent
Definition
SCR_ListViewComponent.c:7
SCR_ListViewComponent::m_aEntryWidgets
ref array< Widget > m_aEntryWidgets
Definition
SCR_ListViewComponent.c:43
SCR_ListViewComponent::m_fScrollPosition
float m_fScrollPosition
Definition
SCR_ListViewComponent.c:49
SCR_ListViewComponent::m_iFocusedEntryId
int m_iFocusedEntryId
Definition
SCR_ListViewComponent.c:54
Widget
Definition
Widget.c:13
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
Components
WidgetLibrary
SCR_ListView
SCR_ButtonListComponent.c
Generated by
1.17.0