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_WidgetListEntryCheckList.c
Go to the documentation of this file.
1
[
BaseContainerProps
(configRoot:
true
)]
2
class
SCR_WidgetListEntryCheckList
:
SCR_WidgetListEntry
3
{
4
[
Attribute
()]
5
protected
ResourceName
m_sElementPath
;
6
7
protected
ref array<ref SCR_LocalizedProperty>
m_aProperties
= {};
8
protected
ref array<ref SCR_ListBoxElementComponent>
m_aCheckboxes
= {};
9
10
//-------------------------------------------------------------------------------------------
12
override
void
CreateWidget
(
Widget
parent)
13
{
14
// Create widget
15
m_EntryRoot
=
GetGame
().GetWorkspace().CreateWidgets(
m_sEntryLayout
, parent);
16
17
// Show
18
m_EntryRoot
.SetVisible(
m_bShow
);
19
if
(!
m_bShow
)
20
return
;
21
22
SetupHandlers
();
23
SetInteractive
(
m_bInteractive
);
24
}
25
26
//-------------------------------------------------------------------------------------------
27
void
ToggleCheckbox
(notnull
SCR_ListBoxElementComponent
checkBox,
bool
enabled)
28
{
29
if
(!
m_aCheckboxes
.Contains(checkBox))
30
{
31
Print
(
"WidgetListEntryCheckList Checkbox couldn't be found"
,
LogLevel
.WARNING);
32
return
;
33
}
34
35
checkBox.SetToggled(enabled);
36
}
37
38
//-------------------------------------------------------------------------------------------
40
SCR_ListBoxElementComponent
AddElement
(
SCR_LocalizedProperty
property,
bool
enabled)
41
{
42
Widget
w =
GetGame
().GetWorkspace().CreateWidgets(
m_sElementPath
,
m_EntryRoot
);
43
SCR_ListBoxElementComponent
button =
SCR_ListBoxElementComponent
.Cast(w.FindHandler(
SCR_ListBoxElementComponent
));
44
if
(!button)
45
return
null;
46
47
button.
SetText
(property.m_sLabel);
48
button.SetToggled(enabled);
49
50
button.m_OnClicked.Insert(
OnCheckboxClick
);
51
52
m_aCheckboxes
.Insert(button);
53
m_aProperties
.Insert(property);
54
55
return
button;
56
}
57
58
//-------------------------------------------------------------------------------------------
59
array<string>
EnabledCheckListPropertyNames
()
60
{
61
array<string> enabled = {};
62
foreach
(
int
i, SCR_ModularButtonComponent checkbox :
m_aCheckboxes
)
63
{
64
if
(checkbox.GetToggled())
65
enabled.Insert(
m_aProperties
[i].
m_sPropertyName
);
66
}
67
68
return
enabled;
69
}
70
71
//-------------------------------------------------------------------------------------------
72
int
CheckboxesCount
()
73
{
74
return
m_aCheckboxes
.Count();
75
}
76
77
//-------------------------------------------------------------------------------------------
78
SCR_ListBoxElementComponent
FindCheckboxByPropertyName
(
string
propertyName)
79
{
80
foreach
(
int
i,
SCR_LocalizedProperty
property :
m_aProperties
)
81
{
82
if
(property.m_sPropertyName == propertyName)
83
return
m_aCheckboxes
[i];
84
}
85
86
return
null;
87
}
88
89
//-------------------------------------------------------------------------------------------
91
protected
void
OnCheckboxClick
(SCR_ModularButtonComponent button)
92
{
93
bool
toggled = button.GetToggled();
94
button.SetToggled(!toggled);
95
}
96
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
ResourceName
Definition
ResourceName.c:13
SCR_ListBoxElementComponent
Element of a listbox.
Definition
SCR_ListBoxElementComponent.c:3
SCR_ListBoxElementComponent::SetText
void SetText(string text)
Definition
SCR_ListBoxElementComponent.c:44
SCR_LocalizedProperty
Variable that is using localized label.
Definition
SCR_WidgetListEntry.c:75
SCR_WidgetListEntryCheckList
Definition
SCR_WidgetListEntryCheckList.c:3
SCR_WidgetListEntryCheckList::m_aProperties
ref array< ref SCR_LocalizedProperty > m_aProperties
Definition
SCR_WidgetListEntryCheckList.c:7
SCR_WidgetListEntryCheckList::m_aCheckboxes
ref array< ref SCR_ListBoxElementComponent > m_aCheckboxes
Definition
SCR_WidgetListEntryCheckList.c:8
SCR_WidgetListEntryCheckList::AddElement
SCR_ListBoxElementComponent AddElement(SCR_LocalizedProperty property, bool enabled)
Add new element and create it in the list.
Definition
SCR_WidgetListEntryCheckList.c:40
SCR_WidgetListEntryCheckList::ToggleCheckbox
void ToggleCheckbox(notnull SCR_ListBoxElementComponent checkBox, bool enabled)
Definition
SCR_WidgetListEntryCheckList.c:27
SCR_WidgetListEntryCheckList::FindCheckboxByPropertyName
SCR_ListBoxElementComponent FindCheckboxByPropertyName(string propertyName)
Definition
SCR_WidgetListEntryCheckList.c:78
SCR_WidgetListEntryCheckList::CreateWidget
override void CreateWidget(Widget parent)
Removed setting up of m_ChangeableComponent as it's not used for this case.
Definition
SCR_WidgetListEntryCheckList.c:12
SCR_WidgetListEntryCheckList::OnCheckboxClick
void OnCheckboxClick(SCR_ModularButtonComponent button)
Handle toggling in script as checkbox can't be interacted without script.
Definition
SCR_WidgetListEntryCheckList.c:91
SCR_WidgetListEntryCheckList::EnabledCheckListPropertyNames
array< string > EnabledCheckListPropertyNames()
Definition
SCR_WidgetListEntryCheckList.c:59
SCR_WidgetListEntryCheckList::CheckboxesCount
int CheckboxesCount()
Definition
SCR_WidgetListEntryCheckList.c:72
SCR_WidgetListEntryCheckList::m_sElementPath
ResourceName m_sElementPath
Definition
SCR_WidgetListEntryCheckList.c:5
SCR_WidgetListEntry
Configurable class for widget.
Definition
SCR_WidgetListEntry.c:116
SCR_WidgetListEntry::SetupHandlers
void SetupHandlers()
Empty function to override to assing custom handlers.
SCR_WidgetListEntry::m_sEntryLayout
ResourceName m_sEntryLayout
Definition
SCR_WidgetListEntry.c:122
SCR_WidgetListEntry::SetInteractive
void SetInteractive(bool interactive)
Can value be interacted - set handler enabled.
Definition
SCR_WidgetListEntry.c:209
SCR_WidgetListEntry::m_EntryRoot
Widget m_EntryRoot
Definition
SCR_WidgetListEntry.c:149
SCR_WidgetListEntry::m_bInteractive
bool m_bInteractive
Definition
SCR_WidgetListEntry.c:143
SCR_WidgetListEntry::m_sPropertyName
string m_sPropertyName
Definition
SCR_WidgetListEntry.c:131
SCR_WidgetListEntry::m_bShow
bool m_bShow
Definition
SCR_WidgetListEntry.c:125
Widget
Definition
Widget.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Menu
ConfigurableWidgetEntries
SCR_WidgetListEntryCheckList.c
Generated by
1.17.0