Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ColorComponent.c
Go to the documentation of this file.
7
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
46{
47 [Attribute("true")]
48 protected bool m_bUseStyleValue;
49
50 [Attribute("0", UIWidgets.ComboBox, "Color style to be applied", "", ParamEnumArray.FromEnum(UiStyleColors) )]
52
53 protected Widget m_wRoot;
54
55 //------------------------------------------------------------------------------------------------
56 override void HandlerAttached(Widget w)
57 {
58 m_wRoot = w;
61 }
62
63 //------------------------------------------------------------------------------------------------
64 protected void ApplyColorization()
65 {
66 Color c = SCR_UIStyle.GetColorFromEnum(m_eColorValue);
67 m_wRoot.SetColor(c);
68 }
69
70 //------------------------------------------------------------------------------------------------
72 {
73 return m_bUseStyleValue;
74 }
75
76 //------------------------------------------------------------------------------------------------
77 void SetUsingStyleValue(bool enable)
78 {
79 m_bUseStyleValue = enable;
80 }
81
82 //------------------------------------------------------------------------------------------------
84 {
85 return m_eColorValue;
86 }
87
88 //------------------------------------------------------------------------------------------------
90 {
91 if (style == m_eColorValue)
92 return;
93
94 m_bUseStyleValue = style;
96 }
97};
UiStyleColors
Definition Color.c:13
Definition Debug.c:13
Minimalist progress bar.
UiStyleColors m_eColorValue
override void HandlerAttached(Widget w)
void SetUsedStyle(UiStyleColors style)
void SetUsingStyleValue(bool enable)
@ WARNING
Definition LogLevel.c:19
@ ERROR
Same as DELETE, but global error count for OnAfterLoad is affected.
Definition LogLevel.c:20
@ NORMAL
Definition LogLevel.c:18
SCR_FieldOfViewSettings Attribute