Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
LoadingScreen.c
Go to the documentation of this file.
1
//#define DEBUG_LOADING_SCREENS
2
3
class
ArmaReforgerLoadingAnim:
BaseLoadingAnim
4
{
5
const
string
LOADING_SCREEN_LAYOUT =
"{4C8B29889444BDA3}UI/layouts/Menus/LoadingScreen/ScenarioLoadingScreen.layout"
;
6
7
static
protected
bool
s_bOpened
;
8
static
ref
ScriptInvoker
s_OnEnterLoadingScreen
=
new
ScriptInvoker
();
9
static
ref
ScriptInvoker
m_onExitLoadingScreen
=
new
ScriptInvoker
();
10
11
private
ref
SCR_LoadingScreenComponent
m_LayoutComponent;
12
13
//------------------------------------------------------------------------------------------------
14
void
ArmaReforgerLoadingAnim(
WorkspaceWidget
workspaceWidget)
15
{
16
GetGame
().m_OnMissionSetInvoker.Insert(OnMissionSet);
17
}
18
19
//------------------------------------------------------------------------------------------------
20
override
void
Load
()
21
{
22
#ifdef DEBUG_LOADING_SCREENS
23
PrintFormat
(
">> %1 >> Load"
,
this
);
24
#endif
25
26
m_wRoot
= m_WorkspaceWidget.CreateWidgets(LOADING_SCREEN_LAYOUT, m_WorkspaceWidget);
27
28
m_LayoutComponent =
new
SCR_LoadingScreenComponent
();
29
m_wRoot
.AddHandler(m_LayoutComponent);
30
31
SplashScreen
.s_iSplashShown++;
32
}
33
34
//------------------------------------------------------------------------------------------------
35
override
void
Update
(
float
timeSlice,
float
progress,
float
minDurationRatio)
36
{
37
#ifdef DEBUG_SPLASH_SCREENS
38
//PrintFormat(">> %1 >> Update | timeSlice: %2 | progress: %3 | minDurationRatio: %4", this, timeSlice, progress, minDurationRatio);
39
#endif
40
41
if
(!
m_wRoot
)
42
return
;
43
44
m_LayoutComponent.Update(timeSlice, progress, minDurationRatio);
45
}
46
47
//------------------------------------------------------------------------------------------------
48
override
void
Show
()
49
{
50
#ifdef DEBUG_LOADING_SCREENS
51
PrintFormat
(
">> %1 >> Show"
,
this
);
52
#endif
53
54
super.Show();
55
56
s_bOpened
=
true
;
57
58
EnableSounds(
false
);
59
60
WidgetManager.SetCursor(12);
// Hide cursor
61
62
s_OnEnterLoadingScreen
.Invoke();
63
}
64
65
//------------------------------------------------------------------------------------------------
66
override
void
Hide
()
67
{
68
#ifdef DEBUG_LOADING_SCREENS
69
PrintFormat
(
">> %1 >> Hide"
,
this
);
70
#endif
71
72
s_bOpened
=
false
;
73
74
EnableSounds(
true
);
75
76
m_onExitLoadingScreen
.Invoke();
77
78
if
(m_LayoutComponent)
79
m_LayoutComponent.OnHideInternal();
80
81
WidgetManager.SetCursor(0);
// Show cursor
82
83
super.Hide();
84
}
85
86
//------------------------------------------------------------------------------------------------
87
void
EnableSounds(
bool
enable)
88
{
89
AudioSystem.SetMasterVolume(AudioSystem.SFX, enable);
90
AudioSystem.SetMasterVolume(AudioSystem.VoiceChat, enable);
91
AudioSystem.SetMasterVolume(AudioSystem.Dialog, enable);
92
AudioSystem.SetMasterVolume(AudioSystem.Music, enable);
93
AudioSystem.SetMasterVolume(AudioSystem.UI, enable);
94
}
95
96
//------------------------------------------------------------------------------------------------
97
static
bool
IsOpen
()
98
{
99
return
s_bOpened
;
100
}
101
102
//------------------------------------------------------------------------------------------------
103
void
OnMissionSet(SCR_MissionHeader header)
104
{
105
if
(m_LayoutComponent)
106
m_LayoutComponent.OnMissionDataRetrieved(header);
107
}
108
109
//------------------------------------------------------------------------------------------------
110
void
SetJoiningCrossPlay(
bool
isCrossPlay)
111
{
112
#ifdef DEBUG_LOADING_SCREENS
113
PrintFormat
(
">> SetJoiningCrossPlay | isCrossPlay: %1"
, isCrossPlay);
114
#endif
115
116
if
(m_LayoutComponent)
117
m_LayoutComponent.SetJoiningCrossPlay(isCrossPlay);
118
}
119
120
//------------------------------------------------------------------------------------------------
121
void
SetLoadingModded(
bool
isModded)
122
{
123
#ifdef DEBUG_LOADING_SCREENS
124
PrintFormat
(
">> SetLoadingModded | isModded: %1"
, isModded);
125
#endif
126
127
if
(m_LayoutComponent)
128
m_LayoutComponent.SetLoadingModded(isModded);
129
}
130
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_wRoot
Widget m_wRoot
Definition
SCR_GameModeCleanSweep.c:25
IsOpen
proto native bool IsOpen()
ArmaReforgerLoadingAnim::m_onExitLoadingScreen
static ref ScriptInvoker m_onExitLoadingScreen
Definition
LoadingScreen.c:9
ArmaReforgerLoadingAnim::s_OnEnterLoadingScreen
static ref ScriptInvoker s_OnEnterLoadingScreen
Definition
LoadingScreen.c:8
ArmaReforgerLoadingAnim::s_bOpened
bool s_bOpened
Definition
LoadingScreen.c:7
SCR_LoadingScreenComponent
Definition
SCR_LoadingScreenComponent.c:2
SplashScreen
Definition
SplashScreen.c:5
WorkspaceWidget
Definition
WorkspaceWidget.c:16
Hide
override void Hide()
Definition
gameLib.c:268
Show
override void Show()
Definition
gameLib.c:262
Load
void Load()
Definition
gameLib.c:220
BaseLoadingAnim
void BaseLoadingAnim(WorkspaceWidget workspaceWidget)
Definition
gameLib.c:233
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
Update
@ Update
Definition
SndComponentCallbacks.c:14
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
LoadingScreen
LoadingScreen.c
Generated by
1.17.0