DayZ
1.24
Loading...
Searching...
No Matches
MainMenuButtonEffect.c
Go to the documentation of this file.
1
class
MainMenuButtonEffect
:
ScriptedWidgetEventHandler
2
{
3
reference
float
speed
;
4
reference
float
amount
;
5
protected
float
m_textProportion
;
6
protected
float
m_textProportion2
;
7
protected
ButtonWidget
m_root
;
8
protected
ref
AnimatorTimer
m_anim
;
9
10
// -----------------------------------------------------------
11
void
MainMenuButtonEffect
()
12
{
13
if
(
GetGame
())
14
GetGame
().GetUpdateQueue(
CALL_CATEGORY_GUI
).Insert(this.
Update
);
15
m_anim =
new
AnimatorTimer
();
16
}
17
18
// -----------------------------------------------------------
19
void
~MainMenuButtonEffect
()
20
{
21
if
(
GetGame
() &&
GetGame
().GetUpdateQueue(
CALL_CATEGORY_GUI
))
22
GetGame
().GetUpdateQueue(
CALL_CATEGORY_GUI
).Remove(this.
Update
);
23
}
24
25
// -----------------------------------------------------------
26
void
OnWidgetScriptInit
(
ButtonWidget
w
)
27
{
28
m_root
=
w
;
29
m_root
.SetHandler(
this
);
30
}
31
32
// -----------------------------------------------------------
33
protected
void
Update
(
float
tDelta
)
34
{
35
m_anim
.Tick(
tDelta
);
36
float
p
=
amount
*
m_anim
.GetValue();
37
//m_root.SetTextProportion( m_textProportion + (p * 0.5) );
38
m_root
.SetTextOffset(
p
* 4, 0);
39
40
float
c
= 1.0 -
m_anim
.GetValue();
41
m_root
.SetTextColor(
ARGBF
(1, 1,
c
,
c
));
42
}
43
44
// -----------------------------------------------------------
45
override
bool
OnFocus
(
Widget
w
,
int
x
,
int
y
)
46
{
47
//if ( !m_anim.IsRunning() ) m_textProportion = m_root.GetTextProportion();
48
if
(!
m_anim
.IsRunning())
49
m_root
.GetPos(
m_textProportion
,
m_textProportion2
);
50
m_anim
.Animate(1.0,
speed
);
51
52
return
false
;
53
}
54
55
// -----------------------------------------------------------
56
override
bool
OnFocusLost
(
Widget
w
,
int
x
,
int
y
)
57
{
58
m_anim
.Animate(0.0,
speed
);
59
return
false
;
60
}
61
};
x
Icon x
y
Icon y
AnimatorTimer
Definition
tools.c:705
MainMenuButtonEffect
Definition
MainMenuButtonEffect.c:2
MainMenuButtonEffect::speed
reference float speed
Definition
MainMenuButtonEffect.c:3
MainMenuButtonEffect::m_textProportion
float m_textProportion
Definition
MainMenuButtonEffect.c:5
MainMenuButtonEffect::Update
void Update(float tDelta)
Definition
MainMenuButtonEffect.c:33
MainMenuButtonEffect::MainMenuButtonEffect
void MainMenuButtonEffect()
Definition
MainMenuButtonEffect.c:11
MainMenuButtonEffect::OnFocusLost
override bool OnFocusLost(Widget w, int x, int y)
Definition
MainMenuButtonEffect.c:56
MainMenuButtonEffect::m_root
ButtonWidget m_root
Definition
MainMenuButtonEffect.c:7
MainMenuButtonEffect::amount
reference float amount
Definition
MainMenuButtonEffect.c:4
MainMenuButtonEffect::~MainMenuButtonEffect
void ~MainMenuButtonEffect()
Definition
MainMenuButtonEffect.c:19
MainMenuButtonEffect::m_anim
ref AnimatorTimer m_anim
Definition
MainMenuButtonEffect.c:8
MainMenuButtonEffect::OnFocus
override bool OnFocus(Widget w, int x, int y)
Definition
MainMenuButtonEffect.c:45
MainMenuButtonEffect::OnWidgetScriptInit
void OnWidgetScriptInit(ButtonWidget w)
Definition
MainMenuButtonEffect.c:26
MainMenuButtonEffect::m_textProportion2
float m_textProportion2
Definition
MainMenuButtonEffect.c:6
Param3
Definition
EntityAI.c:95
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
EnWidgets.c:651
ScriptedWidgetEventHandler::Update
void Update()
Definition
ContinuousActionProgress.c:56
Widget
Definition
EnWidgets.c:190
GetGame
proto native CGame GetGame()
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Definition
tools.c:9
ARGBF
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition
proto.c:332
scripts
3_Game
GUI
Effects
MainMenuButtonEffect.c
Generated by
1.10.0