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_ProgressBarWithSegments.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
SCR_ProgressBarWithSegments
:
SCR_WLibProgressBarComponent
3
{
4
[
Attribute
(defvalue:
"0.761 0.386 0.08 0.059"
,
desc
:
"Progressed Bar Color"
)]
5
protected
ref
Color
m_iProgressedBarColor
;
6
7
[
Attribute
(defvalue:
"0.761 0.484 0.199 1"
,
desc
:
"Minus Bar Color"
)]
8
protected
ref
Color
m_iMinusBarColor
;
9
10
[
Attribute
(
"0.0"
)]
11
protected
float
m_fProgressed
;
12
13
[
Attribute
(
"0.0"
)]
14
protected
float
m_fMinus
;
15
16
17
protected
Widget
m_wProgressedBar
;
18
protected
Widget
m_wMinusBar
;
19
20
//------------------------------------------------------------------------------------------------
21
override
void
HandlerAttached
(
Widget
w)
22
{
23
super.HandlerAttached(w);
24
m_wRoot
.SetVisible(
false
);
25
26
m_wProgressedBar
= w.FindAnyWidget(
"ProgressedBar"
);
27
m_wMinusBar
= w.FindAnyWidget(
"MinusBar"
);
28
29
if
(
m_wProgressedBar
)
30
{
31
m_wProgressedBar
.SetColor(
m_iProgressedBarColor
);
32
if
(
m_bReverseDirection
)
33
m_wBar
.SetZOrder(1);
34
}
35
36
if
(
m_wMinusBar
)
37
{
38
m_wMinusBar
.SetColor(
m_iMinusBarColor
);
39
if
(
m_bReverseDirection
)
40
m_wBar
.SetZOrder(1);
41
}
42
}
43
44
//------------------------------------------------------------------------------------------------
45
protected
override
void
UpdateVisuals
(
bool
animate =
true
)
46
{
47
if
(!
m_wSpacer
|| !
m_wBar
|| !
m_wProgressedBar
|| !
m_wMinusBar
)
48
return
;
49
50
float
original, progressed, minus;
51
52
float
range =
m_fMax
-
m_fMin
;
53
if
(range <= 0)
54
return
;
55
56
original =
m_fValue
/ range;
57
progressed =
m_fProgressed
/ range;
58
minus =
m_fMinus
/ range;
59
60
original =
Math
.Clamp(original, 0, 1);
61
progressed =
Math
.Clamp(progressed, 0, 1);
62
minus =
Math
.Clamp(minus, 0, 1);
63
64
HorizontalLayoutSlot
.SetFillWeight(
m_wBar
, original);
65
HorizontalLayoutSlot
.SetFillWeight(
m_wSpacer
, 1 - original - progressed - minus);
66
67
if
(progressed < original/1000)
68
{
69
m_wProgressedBar
.SetVisible(
false
);
70
m_wProgressedBar
.SetEnabled(
false
);
71
}
72
else
73
{
74
m_wProgressedBar
.SetVisible(
true
);
75
m_wProgressedBar
.SetEnabled(
true
);
76
HorizontalLayoutSlot
.SetFillWeight(
m_wProgressedBar
, progressed);
77
}
78
79
if
(minus < original/1000)
80
{
81
m_wMinusBar
.SetVisible(
false
);
82
m_wMinusBar
.SetEnabled(
false
);
83
}
84
else
85
{
86
m_wMinusBar
.SetVisible(
true
);
87
m_wMinusBar
.SetEnabled(
true
);
88
HorizontalLayoutSlot
.SetFillWeight(
m_wMinusBar
, minus);
89
}
90
91
m_wRoot
.SetVisible(
true
);
92
}
93
94
//------------------------------------------------------------------------------------------------
95
void
SetProgressBarValues
(
float
value,
float
progressed,
float
minus)
96
{
97
m_fValue
= value;
98
m_fProgressed
= progressed;
99
m_fMinus
= minus;
100
UpdateVisuals
();
101
}
102
103
//------------------------------------------------------------------------------------------------
104
override
void
SetValue
(
float
value,
bool
animate =
true
)
105
{
106
super.SetValue(value, animate);
107
108
if
(
m_wProgressedBar
){
109
m_wProgressedBar
.SetVisible(
false
);
110
m_wProgressedBar
.SetEnabled(
false
);
111
}
112
113
if
(
m_wMinusBar
){
114
m_wMinusBar
.SetVisible(
false
);
115
m_wMinusBar
.SetEnabled(
false
);
116
}
117
}
118
};
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
Color
Definition
Color.c:13
HorizontalLayoutSlot
Definition
HorizontalLayoutSlot.c:13
Math
Definition
Math.c:13
SCR_ProgressBarWithSegments
Definition
SCR_ProgressBarWithSegments.c:3
SCR_ProgressBarWithSegments::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ProgressBarWithSegments.c:21
SCR_ProgressBarWithSegments::UpdateVisuals
override void UpdateVisuals(bool animate=true)
Definition
SCR_ProgressBarWithSegments.c:45
SCR_ProgressBarWithSegments::SetProgressBarValues
void SetProgressBarValues(float value, float progressed, float minus)
Definition
SCR_ProgressBarWithSegments.c:95
SCR_ProgressBarWithSegments::m_wProgressedBar
Widget m_wProgressedBar
Definition
SCR_ProgressBarWithSegments.c:17
SCR_ProgressBarWithSegments::SetValue
override void SetValue(float value, bool animate=true)
Definition
SCR_ProgressBarWithSegments.c:104
SCR_ProgressBarWithSegments::m_iProgressedBarColor
ref Color m_iProgressedBarColor
Definition
SCR_ProgressBarWithSegments.c:5
SCR_ProgressBarWithSegments::m_fProgressed
float m_fProgressed
Definition
SCR_ProgressBarWithSegments.c:11
SCR_ProgressBarWithSegments::m_iMinusBarColor
ref Color m_iMinusBarColor
Definition
SCR_ProgressBarWithSegments.c:8
SCR_ProgressBarWithSegments::m_wMinusBar
Widget m_wMinusBar
Definition
SCR_ProgressBarWithSegments.c:18
SCR_ProgressBarWithSegments::m_fMinus
float m_fMinus
Definition
SCR_ProgressBarWithSegments.c:14
SCR_WLibProgressBarComponent
Minimalist progress bar.
Definition
SCR_WLibProgressBar.c:7
SCR_WLibProgressBarComponent::m_wSpacer
Widget m_wSpacer
Definition
SCR_WLibProgressBar.c:37
SCR_WLibProgressBarComponent::m_fMin
float m_fMin
Definition
SCR_WLibProgressBar.c:11
SCR_WLibProgressBarComponent::m_fMax
float m_fMax
Definition
SCR_WLibProgressBar.c:14
SCR_WLibProgressBarComponent::m_wBar
Widget m_wBar
Definition
SCR_WLibProgressBar.c:35
SCR_WLibProgressBarComponent::m_wRoot
Widget m_wRoot
Definition
SCR_WLibProgressBar.c:34
SCR_WLibProgressBarComponent::m_bReverseDirection
bool m_bReverseDirection
Definition
SCR_WLibProgressBar.c:20
SCR_WLibProgressBarComponent::m_fValue
float m_fValue
Definition
SCR_WLibProgressBar.c:17
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Menu
CareerProfile
SCR_ProgressBarWithSegments.c
Generated by
1.17.0