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_IntroSplashScreenComponent.c
Go to the documentation of this file.
1
class
SCR_IntroSplashScreenComponent
:
ScriptedWidgetComponent
2
{
3
protected
Widget
m_wRoot
;
4
5
protected
ref
SCR_IntroSplashScreenWidgets
m_Widgets
;
6
protected
SCR_LoadingSpinner
m_SpinnerComp
;
7
8
protected
static
const
float
FADEIN_TIME
= 2;
9
10
//------------------------------------------------------------------------------------------------
11
override
protected
void
HandlerAttached
(
Widget
w)
12
{
13
m_wRoot
= w;
14
15
m_Widgets
=
new
SCR_IntroSplashScreenWidgets
();
16
m_Widgets
.Init(
m_wRoot
);
17
18
m_wRoot
.SetZOrder(1001);
19
20
// Get spinner component
21
if
(
m_Widgets
.m_wSpinner)
22
{
23
Widget
compWidget =
m_Widgets
.m_wSpinner.FindAnyWidget(
"Spinner"
);
24
25
if
(compWidget)
26
m_SpinnerComp
=
SCR_LoadingSpinner
.Cast(compWidget.FindHandler(
SCR_LoadingSpinner
));
27
}
28
29
InitWidgets
();
30
}
31
32
//------------------------------------------------------------------------------------------------
33
protected
void
InitWidgets
()
34
{
35
// Disable widgets
36
m_Widgets
.m_wDust1.SetVisible(
false
);
37
m_Widgets
.m_wDust2.SetVisible(
false
);
38
m_Widgets
.m_wWarning.SetVisible(
false
);
39
m_Widgets
.m_wExperimentalBuild.SetVisible(
false
);
40
m_Widgets
.m_wArtExperimental.SetVisible(
false
);
41
42
// Prepare widgets for fade-in
43
m_Widgets
.m_wBILogo.SetOpacity(0);
44
m_Widgets
.m_wEnfusionLogo.SetOpacity(0);
45
m_Widgets
.m_wDisclaimer.SetOpacity(0);
46
m_Widgets
.m_wSpinner.SetOpacity(0);
47
48
// Show widgets
49
m_Widgets
.m_wArt.SetOpacity(1);
50
}
51
52
//------------------------------------------------------------------------------------------------
55
void
Update
(
float
timeSlice)
56
{
57
Fade
(
m_Widgets
.m_wBILogo,
true
,
FADEIN_TIME
, timeSlice);
58
Fade
(
m_Widgets
.m_wEnfusionLogo,
true
,
FADEIN_TIME
, timeSlice);
59
Fade
(
m_Widgets
.m_wDisclaimer,
true
,
FADEIN_TIME
, timeSlice);
60
Fade
(
m_Widgets
.m_wSpinner,
true
,
FADEIN_TIME
, timeSlice);
61
62
// Rotate spinner
63
if
(
m_SpinnerComp
)
64
m_SpinnerComp
.Update(timeSlice);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
protected
void
Fade
(
Widget
w,
bool
show,
float
length,
float
timeslice)
69
{
70
if
(length <= 0)
71
{
72
w.SetOpacity(show);
73
return
;
74
}
75
76
float
opacityCurrent = w.GetOpacity();
77
78
if
(opacityCurrent == show)
79
return
;
80
81
float
progressDelta = timeslice / length;
82
83
if
(!show)
84
progressDelta = -progressDelta;
85
86
float
progress = opacityCurrent + progressDelta;
87
88
progress =
Math
.Clamp(progress, 0, 1);
89
90
float
opacity =
Math
.Lerp(0, 1, progress);
91
w.SetOpacity(opacity);
92
w.SetVisible(
true
);
93
}
94
}
Math
Definition
Math.c:13
SCR_IntroSplashScreenComponent
Definition
SCR_IntroSplashScreenComponent.c:2
SCR_IntroSplashScreenComponent::InitWidgets
void InitWidgets()
Definition
SCR_IntroSplashScreenComponent.c:33
SCR_IntroSplashScreenComponent::Update
void Update(float timeSlice)
Definition
SCR_IntroSplashScreenComponent.c:55
SCR_IntroSplashScreenComponent::m_Widgets
ref SCR_IntroSplashScreenWidgets m_Widgets
Definition
SCR_IntroSplashScreenComponent.c:5
SCR_IntroSplashScreenComponent::m_SpinnerComp
SCR_LoadingSpinner m_SpinnerComp
Definition
SCR_IntroSplashScreenComponent.c:6
SCR_IntroSplashScreenComponent::m_wRoot
Widget m_wRoot
Definition
SCR_IntroSplashScreenComponent.c:3
SCR_IntroSplashScreenComponent::Fade
void Fade(Widget w, bool show, float length, float timeslice)
Definition
SCR_IntroSplashScreenComponent.c:68
SCR_IntroSplashScreenComponent::FADEIN_TIME
static const float FADEIN_TIME
Definition
SCR_IntroSplashScreenComponent.c:8
SCR_IntroSplashScreenComponent::HandlerAttached
void HandlerAttached(Widget w)
Definition
SCR_IntroSplashScreenComponent.c:11
SCR_IntroSplashScreenWidgets
Definition
SCR_IntroSplashScreenWidgets.c:5
SCR_LoadingSpinner
Definition
SCR_LoadingSpinner.c:2
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
Widget
Definition
Widget.c:13
scripts
GameLib
LoadingScreens
SCR_IntroSplashScreenComponent.c
Generated by
1.17.0