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_ServerDetailEntry.c
Go to the documentation of this file.
1
// Class for unifiying simple details widget behavior
2
// Widget is displaying label, icons and additional data. Also it's appearance can be change on run to some extend.
3
//------------------------------------------------------------------------------------------------
4
5
class
SCR_ServerDetailEntryComponent
:
SCR_WLibComponentBase
6
{
7
const
string
WIDGET_LABEL =
"Content"
;
8
const
string
WIDGET_ICON =
"Icon"
;
9
const
string
WIDGET_DATA =
"Data"
;
10
11
const
string
WIDGET_BACKGROUND =
"Background"
;
12
13
[
Attribute
(
"true"
)]
14
protected
bool
m_bVisibleBackground
;
15
16
[
Attribute
(
"true"
)]
17
protected
bool
m_bVisibleIcon
;
18
19
[
Attribute
(
"true"
)]
20
protected
bool
m_bVisibleData
;
21
22
[
Attribute
()]
23
protected
string
m_sLabel
;
24
25
[
Attribute
(
UIConstants
.ICONS_IMAGE_SET,
UIWidgets
.ResourceNamePicker)]
26
protected
ResourceName
m_ImageSetDefault
;
27
28
[
Attribute
()]
29
protected
string
m_sImage
;
30
31
protected
TextWidget
m_wTxtLabel
;
32
protected
ImageWidget
m_wImgIcon
;
33
protected
TextWidget
m_wTxtData
;
34
35
protected
ImageWidget
m_wImgBackground
;
36
37
//------------------------------------------------------------------------------------------------
38
override
void
HandlerAttached
(
Widget
w)
39
{
40
super.HandlerAttached(w);
41
42
// Find widget elements
43
m_wTxtLabel
=
TextWidget
.Cast(w.FindAnyWidget(WIDGET_LABEL));
44
m_wImgIcon
=
ImageWidget
.Cast(w.FindAnyWidget(WIDGET_ICON));
45
m_wTxtData
=
TextWidget
.Cast(w.FindAnyWidget(WIDGET_DATA));
46
47
m_wImgBackground
=
ImageWidget
.Cast(w.FindAnyWidget(WIDGET_BACKGROUND));
48
49
// Visual setup
50
VisualSetup
();
51
SetIconFromImageSet
(
m_sImage
,
m_ImageSetDefault
);
52
}
53
54
//------------------------------------------------------------------------------------------------
55
protected
void
VisualSetup
()
56
{
57
// Background
58
if
(
m_wImgBackground
)
59
{
60
m_wImgBackground
.SetVisible(
m_bVisibleBackground
);
61
}
62
63
// Icon
64
if
(
m_wImgIcon
)
65
{
66
m_wImgIcon
.SetVisible(
m_bVisibleIcon
);
67
}
68
69
// Data
70
if
(
m_wTxtData
)
71
{
72
m_wTxtData
.SetVisible(
m_bVisibleData
);
73
}
74
75
// Label
76
if
(
m_wTxtLabel
&& !
m_sLabel
.IsEmpty())
77
{
78
m_wTxtLabel
.SetText(
m_sLabel
);
79
}
80
}
81
82
// User API
83
//------------------------------------------------------------------------------------------------
84
void
SetLabelText
(
string
text)
85
{
86
if
(
m_wTxtLabel
)
87
m_wTxtLabel
.SetText(text);
88
}
89
90
//------------------------------------------------------------------------------------------------
91
void
SetIconFromImageSet
(
string
text,
ResourceName
imageSet =
string
.Empty)
92
{
93
if
(!imageSet)
94
imageSet =
m_ImageSetDefault
;
95
96
if
(!imageSet)
97
return
;
98
99
m_sImage
= text;
100
101
if
(
m_wImgIcon
)
102
m_wImgIcon
.LoadImageFromSet(0, imageSet,
m_sImage
);
103
}
104
105
//------------------------------------------------------------------------------------------------
106
void
SetDataText
(
string
text)
107
{
108
if
(
m_wTxtData
)
109
m_wTxtData
.SetText(text);
110
}
111
112
//------------------------------------------------------------------------------------------------
113
void
SetElementsVisible
(
bool
label,
bool
icon,
bool
data
)
114
{
115
if
(
m_wTxtLabel
)
116
m_wTxtLabel
.SetVisible(label);
117
118
if
(
m_wImgIcon
)
119
m_wImgIcon
.SetVisible(icon);
120
121
if
(
m_wTxtData
)
122
m_wTxtData
.SetVisible(
data
);
123
124
}
125
126
//------------------------------------------------------------------------------------------------
127
void
SetBackroundVisible
(
bool
visible)
128
{
129
if
(
m_wImgBackground
)
130
{
131
m_wImgBackground
.SetVisible(visible);
132
}
133
}
134
};
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
ImageWidget
Definition
ImageWidget.c:13
ResourceName
Definition
ResourceName.c:13
SCR_ServerDetailEntryComponent
Definition
SCR_ServerDetailEntry.c:6
SCR_ServerDetailEntryComponent::m_bVisibleData
bool m_bVisibleData
Definition
SCR_ServerDetailEntry.c:20
SCR_ServerDetailEntryComponent::SetBackroundVisible
void SetBackroundVisible(bool visible)
Definition
SCR_ServerDetailEntry.c:127
SCR_ServerDetailEntryComponent::SetIconFromImageSet
void SetIconFromImageSet(string text, ResourceName imageSet=string.Empty)
Definition
SCR_ServerDetailEntry.c:91
SCR_ServerDetailEntryComponent::SetLabelText
void SetLabelText(string text)
Definition
SCR_ServerDetailEntry.c:84
SCR_ServerDetailEntryComponent::SetElementsVisible
void SetElementsVisible(bool label, bool icon, bool data)
Definition
SCR_ServerDetailEntry.c:113
SCR_ServerDetailEntryComponent::m_sLabel
string m_sLabel
Definition
SCR_ServerDetailEntry.c:23
SCR_ServerDetailEntryComponent::m_wTxtData
TextWidget m_wTxtData
Definition
SCR_ServerDetailEntry.c:33
SCR_ServerDetailEntryComponent::m_wImgIcon
ImageWidget m_wImgIcon
Definition
SCR_ServerDetailEntry.c:32
SCR_ServerDetailEntryComponent::m_bVisibleBackground
bool m_bVisibleBackground
Definition
SCR_ServerDetailEntry.c:14
SCR_ServerDetailEntryComponent::m_ImageSetDefault
ResourceName m_ImageSetDefault
Definition
SCR_ServerDetailEntry.c:26
SCR_ServerDetailEntryComponent::m_sImage
string m_sImage
Definition
SCR_ServerDetailEntry.c:29
SCR_ServerDetailEntryComponent::SetDataText
void SetDataText(string text)
Definition
SCR_ServerDetailEntry.c:106
SCR_ServerDetailEntryComponent::m_wTxtLabel
TextWidget m_wTxtLabel
Definition
SCR_ServerDetailEntry.c:31
SCR_ServerDetailEntryComponent::m_bVisibleIcon
bool m_bVisibleIcon
Definition
SCR_ServerDetailEntry.c:17
SCR_ServerDetailEntryComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ServerDetailEntry.c:38
SCR_ServerDetailEntryComponent::m_wImgBackground
ImageWidget m_wImgBackground
Definition
SCR_ServerDetailEntry.c:35
SCR_ServerDetailEntryComponent::VisualSetup
void VisualSetup()
Definition
SCR_ServerDetailEntry.c:55
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition
SCR_WLibComponentBase.c:9
TextWidget
Definition
TextWidget.c:16
UIConstants
Definition
Constants.c:151
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Menu
ServerBrowser
SCR_ServerDetailEntry.c
Generated by
1.17.0