DayZ
1.29
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
RadialProgressBar.c
См. документацию.
1
// -----------------------------------------------------------
2
class
RadialProgressBar
3
{
4
reference
float
speed
;
5
reference
float
start_rotation
;
6
7
protected
string
m_BarHider
;
8
protected
string
m_BarPart
;
9
protected
Widget
m_Root
;
10
protected
ref
AnimatorTimer
m_Anim
;
11
protected
float
x
,
y
,
z
;
12
protected
float
rotation
= 0;
13
protected
int
stage
= 0;
14
15
// -----------------------------------------------------------
16
void
RadialProgressBar
()
17
{
18
m_Anim
=
new
AnimatorTimer
();
19
g_Game
.GetUpdateQueue(
CALL_CATEGORY_GUI
).Insert(this.
Update
);
20
}
21
22
// -----------------------------------------------------------
23
void
~RadialProgressBar
()
24
{
25
g_Game
.GetUpdateQueue(
CALL_CATEGORY_GUI
).Remove(this.
Update
);
26
}
27
28
void
SetProgress
(
float
progress )
29
{
30
if
( progress < 50 )
31
{
32
stage
= 0;
33
}
34
rotation
= 360 * ( progress / 100 );
35
}
36
37
// -----------------------------------------------------------
38
protected
void
Update
(
float
tDelta)
39
{
40
m_Anim
.Tick(tDelta);
41
42
Widget
child =
m_Root
.GetChildren();
43
44
int
index = 0;
45
while
( child )
46
{
47
UpdateChild
( child, index );
48
index++;
49
child = child.GetSibling();
50
}
51
}
52
53
protected
void
UpdateChild
(
Widget
child,
int
index )
54
{
55
float
rotation_value = (
m_Anim
.GetTargetValue() *
Math
.
RAD2DEG
);
56
if
( child.GetName() ==
m_BarHider
)
57
{
58
if
(
stage
== 0 )
59
{
60
if
(
rotation
> 0 )
61
{
62
child.GetChildren().Show(
true
);
63
}
64
else
65
{
66
child.GetChildren().Show(
false
);
67
}
68
69
child.GetChildren().SetRotation( 0, 0,
start_rotation
+
rotation
);
70
71
if
(
rotation
> 180 )
72
{
73
stage
= 1;
74
child.GetChildren().SetRotation(0, 0, 360);
75
}
76
77
}
78
}
79
else
if
( child.GetName() ==
m_BarPart
)
80
{
81
if
(
stage
== 0 )
82
child.Show(
false
);
83
if
(
stage
== 1 )
84
{
85
child.Show(
true
);
86
child.SetRotation( 0, 0,
start_rotation
+
rotation
);
87
88
if
(
rotation
> 360 )
89
{
90
stage
= 2;
91
child.SetRotation( 0, 0, 180 );
92
}
93
}
94
}
95
}
96
97
// -----------------------------------------------------------
98
void
OnWidgetScriptInit
(
Widget
w )
99
{
100
m_Root
= w;
101
m_BarHider
=
"BarHider_"
+
m_Root
.GetName();
102
m_BarPart
=
"BarPart2_"
+
m_Root
.GetName();
103
m_Anim
.AnimateLoop(
speed
);
104
}
105
};
g_Game
DayZGame g_Game
Определения
DayZGame.c:3942
AnimatorTimer
Определения
3_Game/DayZ/tools/tools.c:747
Math
Определения
EnMath.c:7
RadialProgressBar::m_Root
Widget m_Root
Определения
RadialProgressBar.c:9
RadialProgressBar::m_BarPart
string m_BarPart
Определения
RadialProgressBar.c:8
RadialProgressBar::RadialProgressBar
void RadialProgressBar()
Определения
RadialProgressBar.c:16
RadialProgressBar::SetProgress
void SetProgress(float progress)
Определения
RadialProgressBar.c:28
RadialProgressBar::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Определения
RadialProgressBar.c:98
RadialProgressBar::m_BarHider
string m_BarHider
Определения
RadialProgressBar.c:7
RadialProgressBar::start_rotation
reference float start_rotation
Определения
RadialProgressBar.c:5
RadialProgressBar::x
float x
Определения
RadialProgressBar.c:11
RadialProgressBar::m_Anim
ref AnimatorTimer m_Anim
Определения
RadialProgressBar.c:10
RadialProgressBar::Update
void Update(float tDelta)
Определения
RadialProgressBar.c:38
RadialProgressBar::rotation
float rotation
Определения
RadialProgressBar.c:12
RadialProgressBar::z
float z
Определения
RadialProgressBar.c:11
RadialProgressBar::y
float y
Определения
RadialProgressBar.c:11
RadialProgressBar::stage
int stage
Определения
RadialProgressBar.c:13
RadialProgressBar::~RadialProgressBar
void ~RadialProgressBar()
Определения
RadialProgressBar.c:23
RadialProgressBar::UpdateChild
void UpdateChild(Widget child, int index)
Определения
RadialProgressBar.c:53
RadialProgressBar::speed
reference float speed
Определения
RadialProgressBar.c:4
Widget
Определения
EnWidgets.c:190
Math::RAD2DEG
static const float RAD2DEG
Определения
EnMath.c:16
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Определения
3_Game/DayZ/tools/tools.c:9
Ishodniki
scripts
3_Game
DayZ
GUI
Effects
RadialProgressBar.c
Создано системой
1.13.2