3 static const int PRELOAD_FRAME_TIME_MS = 100;
4 static const int MIN_DURATION_MS = 1000;
5 ref LoadingAnim m_LoadingAnim;
12 Print(
"SimplePreload: preload started.", LogLevel.VERBOSE);
19 Print(
"SimplePreload: preload finished (took: " + Math.Round(
m_fDuration) +
"s).", LogLevel.VERBOSE);
22 bool Update(
float timeSlice)
26 if (g_Game.IsPreloadFinished() && (
m_fDuration >= (MIN_DURATION_MS * 0.001)))
33 float progress = Math.Min(
m_fDuration / MIN_DURATION_MS * 0.001, 1.0);
34 m_LoadingAnim.Update(timeSlice, progress, progress);
41 if (g_Game.BeginPreload(g_Game.GetWorld(),
position, radius, max_duration_ms / 1000))
45 preload.m_LoadingAnim = g_Game.CreateLoadingAnim(g_Game.GetWorkspace());
46 preload.m_LoadingAnim.Show();
47 preload.m_iMaxDuration = max_duration_ms;