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_SelectionMenuEntryIconComponent.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
SCR_SelectionMenuEntryIconComponent
:
SCR_SelectionMenuEntryComponent
3
{
4
[
Attribute
(
"Icon"
)]
5
protected
string
m_sIcon
;
6
7
[
Attribute
(
"255 255 255 255"
)]
8
protected
ref
Color
m_cDefaultColor
;
9
10
[
Attribute
(
"255 255 255 255"
)]
11
protected
ref
Color
m_cAltColor
;
12
13
protected
ImageWidget
m_wIcon
;
14
15
protected
ResourceName
m_sTexture
;
16
protected
string
m_sImage
;
17
18
//------------------------------------------------------------------------------------------------
19
// Override
20
//------------------------------------------------------------------------------------------------
21
22
//------------------------------------------------------------------------------------------------
23
override
void
HandlerAttached
(
Widget
w)
24
{
25
super.HandlerAttached(w);
26
27
m_wIcon
=
ImageWidget
.Cast(
m_wRoot
.FindAnyWidget(
m_sIcon
));
28
}
29
30
//------------------------------------------------------------------------------------------------
32
override
void
SetEntry
(
SCR_SelectionMenuEntry
entry)
33
{
34
// Clear previous referenced entry
35
if
(
m_Entry
)
36
{
37
m_Entry
.GetOnIconChange().Remove(
OnEntryIconChange
);
38
}
39
40
// Setup new entry
41
super.SetEntry(entry);
42
43
if
(!entry)
44
return
;
45
46
m_Entry
.GetOnIconChange().Insert(
OnEntryIconChange
);
47
}
48
49
//------------------------------------------------------------------------------------------------
50
// Custom
51
//------------------------------------------------------------------------------------------------
52
53
//------------------------------------------------------------------------------------------------
54
void
SetImage
(
ResourceName
texture,
string
image)
55
{
56
m_sTexture
= texture;
57
m_sImage
= image;
58
59
SCR_WLibComponentBase
.
SetTexture
(
m_wIcon
,
m_sTexture
,
m_sImage
);
60
}
61
62
//------------------------------------------------------------------------------------------------
63
void
SetLayoutSize
(
float
size
)
64
{
65
if
(
m_wSizeLayout
)
66
FrameSlot
.SetSize(
m_wSizeLayout
,
size
,
size
);
67
}
68
69
//------------------------------------------------------------------------------------------------
70
void
SetIconColor
(
Color
color = null)
71
{
72
if
(!
m_wIcon
)
73
return
;
74
75
if
(color == null)
76
m_wIcon
.SetColor(
m_cDefaultColor
);
77
else
78
m_wIcon
.SetColor(color);
79
}
80
81
//------------------------------------------------------------------------------------------------
82
Color
GetAltColor
()
83
{
84
return
Color
.FromInt(
m_cAltColor
.PackToInt());
85
}
86
87
//------------------------------------------------------------------------------------------------
88
// Callback
89
//------------------------------------------------------------------------------------------------
90
91
//------------------------------------------------------------------------------------------------
92
protected
void
OnEntryIconChange
(
SCR_SelectionMenuEntry
entry,
ResourceName
texture,
string
image)
93
{
94
SetImage
(texture, image);
95
}
96
}
size
int size
Definition
PrefabImporter.c:35
Color
Definition
Color.c:13
FrameSlot
Definition
FrameSlot.c:13
ImageWidget
Definition
ImageWidget.c:13
ResourceName
Definition
ResourceName.c:13
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SelectionMenuEntryComponent
Definition
SCR_SelectionMenuEntryComponent.c:7
SCR_SelectionMenuEntryComponent::m_Entry
SCR_SelectionMenuEntry m_Entry
Definition
SCR_SelectionMenuEntryComponent.c:17
SCR_SelectionMenuEntryComponent::m_wSizeLayout
Widget m_wSizeLayout
Definition
SCR_SelectionMenuEntryComponent.c:23
SCR_SelectionMenuEntry
Definition
SCR_SelectionMenuEntry.c:8
SCR_SelectionMenuEntryIconComponent
Definition
SCR_SelectionMenuEntryIconComponent.c:3
SCR_SelectionMenuEntryIconComponent::SetImage
void SetImage(ResourceName texture, string image)
Definition
SCR_SelectionMenuEntryIconComponent.c:54
SCR_SelectionMenuEntryIconComponent::SetLayoutSize
void SetLayoutSize(float size)
Definition
SCR_SelectionMenuEntryIconComponent.c:63
SCR_SelectionMenuEntryIconComponent::OnEntryIconChange
void OnEntryIconChange(SCR_SelectionMenuEntry entry, ResourceName texture, string image)
Definition
SCR_SelectionMenuEntryIconComponent.c:92
SCR_SelectionMenuEntryIconComponent::m_wIcon
ImageWidget m_wIcon
Definition
SCR_SelectionMenuEntryIconComponent.c:13
SCR_SelectionMenuEntryIconComponent::m_sIcon
string m_sIcon
Definition
SCR_SelectionMenuEntryIconComponent.c:5
SCR_SelectionMenuEntryIconComponent::m_sTexture
ResourceName m_sTexture
Definition
SCR_SelectionMenuEntryIconComponent.c:15
SCR_SelectionMenuEntryIconComponent::SetEntry
override void SetEntry(SCR_SelectionMenuEntry entry)
Set entry holding data driving this visuals.
Definition
SCR_SelectionMenuEntryIconComponent.c:32
SCR_SelectionMenuEntryIconComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_SelectionMenuEntryIconComponent.c:23
SCR_SelectionMenuEntryIconComponent::m_cDefaultColor
ref Color m_cDefaultColor
Definition
SCR_SelectionMenuEntryIconComponent.c:8
SCR_SelectionMenuEntryIconComponent::m_sImage
string m_sImage
Definition
SCR_SelectionMenuEntryIconComponent.c:16
SCR_SelectionMenuEntryIconComponent::GetAltColor
Color GetAltColor()
Definition
SCR_SelectionMenuEntryIconComponent.c:82
SCR_SelectionMenuEntryIconComponent::m_cAltColor
ref Color m_cAltColor
Definition
SCR_SelectionMenuEntryIconComponent.c:11
SCR_SelectionMenuEntryIconComponent::SetIconColor
void SetIconColor(Color color=null)
Definition
SCR_SelectionMenuEntryIconComponent.c:70
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition
SCR_WLibComponentBase.c:9
SCR_WLibComponentBase::SetTexture
static bool SetTexture(ImageWidget widget, ResourceName texture, string image="")
Definition
SCR_WLibComponentBase.c:130
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
SelectionMenu
Entries
SCR_SelectionMenuEntryIconComponent.c
Generated by
1.17.0