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_ContentBrowserSortingBarComponent.c
Go to the documentation of this file.
1
class
SCR_ContentBrowserSortingBar
:
SCR_ServerFilterBarComponent
2
{
3
4
[
Attribute
()]
5
bool
m_bDefaultSelected =
true
;
6
7
SCR_ButtonImageComponent
m_CurrentSelection;
8
protected
int
m_iCurrentIndex
;
9
protected
ref array<SCR_ButtonImageComponent>
m_aButtons
=
new
array<SCR_ButtonImageComponent>();
10
11
ref
ScriptInvoker
m_OnSortingChange
=
new
ScriptInvoker
();
12
13
override
void
HandlerAttached
(
Widget
w)
14
{
15
super.HandlerAttached(w);
16
m_iCurrentIndex
=
m_aButtons
.Count() - 1;
17
m_CurrentSelection =
m_aButtons
[
m_iCurrentIndex
];
18
19
m_aButtons
[
m_iCurrentIndex
].SetToggled(
true
,
false
,
false
);
20
}
21
22
23
protected
override
void
ListenToSelectables
(notnull array<Widget> aWidgets)
24
{
25
foreach
(
Widget
w : aWidgets)
26
{
27
SCR_ButtonImageComponent
comp =
SCR_ButtonImageComponent
.Cast(w.FindHandler(
SCR_ButtonImageComponent
));
28
if
(!comp)
29
return
;
30
m_aButtons
.Insert(comp);
31
comp.m_OnToggled.Insert(
OnSorting
);
32
//Print("attach listener");
33
}
34
}
35
36
int
GetSelectedIndex
()
37
{
38
return
m_iCurrentIndex
;
39
}
40
41
protected
void
OnSorting
(
SCR_ButtonImageComponent
comp,
bool
isSelected)
42
{
43
int
index
= -1;
44
if
(isSelected)
45
{
46
if
(m_CurrentSelection)
47
m_CurrentSelection.SetToggled(
false
,
true
,
false
);
48
m_CurrentSelection = comp;
49
index
=
m_aButtons
.Find(comp);
50
m_iCurrentIndex
=
index
;
51
}
52
else
53
{
54
m_CurrentSelection.SetToggled(
true
,
false
,
false
);
55
return
;
56
}
57
58
m_OnSortingChange
.Invoke(
index
);
59
60
}
61
};
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
SCR_ButtonImageComponent
Definition
SCR_ButtonImageComponent.c:3
SCR_ContentBrowserSortingBar
Definition
SCR_ContentBrowserSortingBarComponent.c:2
SCR_ContentBrowserSortingBar::m_OnSortingChange
ref ScriptInvoker m_OnSortingChange
Definition
SCR_ContentBrowserSortingBarComponent.c:11
SCR_ContentBrowserSortingBar::ListenToSelectables
override void ListenToSelectables(notnull array< Widget > aWidgets)
Definition
SCR_ContentBrowserSortingBarComponent.c:23
SCR_ContentBrowserSortingBar::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ContentBrowserSortingBarComponent.c:13
SCR_ContentBrowserSortingBar::m_aButtons
ref array< SCR_ButtonImageComponent > m_aButtons
Definition
SCR_ContentBrowserSortingBarComponent.c:9
SCR_ContentBrowserSortingBar::m_iCurrentIndex
int m_iCurrentIndex
Definition
SCR_ContentBrowserSortingBarComponent.c:8
SCR_ContentBrowserSortingBar::GetSelectedIndex
int GetSelectedIndex()
Definition
SCR_ContentBrowserSortingBarComponent.c:36
SCR_ContentBrowserSortingBar::OnSorting
void OnSorting(SCR_ButtonImageComponent comp, bool isSelected)
Definition
SCR_ContentBrowserSortingBarComponent.c:41
SCR_ServerFilterBarComponent
Definition
SCR_ServerFilterBarComponent.c:3
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
Menu
SCR_ContentBrowserSortingBarComponent.c
Generated by
1.17.0