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_ColorComponent.c
Go to the documentation of this file.
1
enum
UiStyleColors
2
{
3
NORMAL
,
4
WARNING
,
5
ERROR
,
6
};
7
8
class
SCR_UIStyle
9
{
10
static
Color
colorNormal =
Color
.Green;
11
static
Color
colorWarning =
Color
.Yellow;
12
static
Color
colorError =
Color
.Red;
13
14
//------------------------------------------------------------------------------------------------
15
static
Color
GetColorFromEnum(
UiStyleColors
color)
16
{
17
switch
(color)
18
{
19
case
UiStyleColors
.NORMAL:
20
return
colorNormal;
21
case
UiStyleColors
.WARNING:
22
return
colorWarning;
23
case
UiStyleColors
.ERROR:
24
return
colorError;
25
default :
26
Debug
.Error(
"Invalid color selected"
);
27
}
28
return
null;
29
}
30
31
//------------------------------------------------------------------------------------------------
32
static
string
GetColorString(
Color
color)
33
{
34
return
"0.5 0.5 0.5 0.5"
;
35
}
36
37
//------------------------------------------------------------------------------------------------
38
static
string
GetColorString(
UiStyleColors
colorStyle)
39
{
40
return
GetColorString(GetColorFromEnum(colorStyle));
41
}
42
};
43
45
class
SCR_ColorComponent
:
ScriptedWidgetComponent
46
{
47
[
Attribute
(
"true"
)]
48
protected
bool
m_bUseStyleValue
;
49
50
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"Color style to be applied"
,
""
, ParamEnumArray.FromEnum(
UiStyleColors
) )]
51
protected
UiStyleColors
m_eColorValue
;
52
53
protected
Widget
m_wRoot
;
54
55
//------------------------------------------------------------------------------------------------
56
override
void
HandlerAttached
(
Widget
w)
57
{
58
m_wRoot
= w;
59
if
(
m_bUseStyleValue
)
60
ApplyColorization
();
61
}
62
63
//------------------------------------------------------------------------------------------------
64
protected
void
ApplyColorization
()
65
{
66
Color
c =
SCR_UIStyle
.GetColorFromEnum(
m_eColorValue
);
67
m_wRoot
.SetColor(c);
68
}
69
70
//------------------------------------------------------------------------------------------------
71
bool
IsUsingSyleValue
()
72
{
73
return
m_bUseStyleValue
;
74
}
75
76
//------------------------------------------------------------------------------------------------
77
void
SetUsingStyleValue
(
bool
enable)
78
{
79
m_bUseStyleValue
= enable;
80
}
81
82
//------------------------------------------------------------------------------------------------
83
bool
GetUsedStyle
()
84
{
85
return
m_eColorValue
;
86
}
87
88
//------------------------------------------------------------------------------------------------
89
void
SetUsedStyle
(
UiStyleColors
style)
90
{
91
if
(style ==
m_eColorValue
)
92
return
;
93
94
m_bUseStyleValue
= style;
95
ApplyColorization
();
96
}
97
};
UiStyleColors
UiStyleColors
Definition
SCR_ColorComponent.c:2
Color
Definition
Color.c:13
Debug
Definition
Debug.c:13
SCR_ColorComponent
Minimalist progress bar.
Definition
SCR_ColorComponent.c:46
SCR_ColorComponent::ApplyColorization
void ApplyColorization()
Definition
SCR_ColorComponent.c:64
SCR_ColorComponent::IsUsingSyleValue
bool IsUsingSyleValue()
Definition
SCR_ColorComponent.c:71
SCR_ColorComponent::m_eColorValue
UiStyleColors m_eColorValue
Definition
SCR_ColorComponent.c:51
SCR_ColorComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ColorComponent.c:56
SCR_ColorComponent::GetUsedStyle
bool GetUsedStyle()
Definition
SCR_ColorComponent.c:83
SCR_ColorComponent::SetUsedStyle
void SetUsedStyle(UiStyleColors style)
Definition
SCR_ColorComponent.c:89
SCR_ColorComponent::SetUsingStyleValue
void SetUsingStyleValue(bool enable)
Definition
SCR_ColorComponent.c:77
SCR_ColorComponent::m_bUseStyleValue
bool m_bUseStyleValue
Definition
SCR_ColorComponent.c:48
SCR_ColorComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ColorComponent.c:53
SCR_UIStyle
Definition
SCR_ColorComponent.c:9
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
WARNING
@ WARNING
Definition
LogLevel.c:19
ERROR
@ ERROR
Same as DELETE, but global error count for OnAfterLoad is affected.
Definition
LogLevel.c:20
NORMAL
@ NORMAL
Definition
LogLevel.c:18
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Components
WidgetLibrary
SCR_ColorComponent.c
Generated by
1.17.0