5 [
EntityEditorProps(
category:
"GameScripted/Menu", description:
"When put into a level will make sure that the main menu is open.")]
13 [
Attribute(
"ChimeraMenuPreset.MainMenu", UIWidgets.SearchComboBox,
"Menu to launch at start of the world",
"", ParamEnumArray.FromEnum(
ChimeraMenuPreset) )]
16 [
Attribute(
"{1C71B463B3B66BAB}UI/layouts/Menus/MainMenu/IntroSplashScreen.layout")]
17 private ResourceName m_sSplashScreenLayout;
27 SetEventMask(EntityEvent.FRAME);
28 SetFlags(EntityFlags.NO_TREE | EntityFlags.NO_LINK);
35 GetGame().m_bIsMainMenuOpen =
false;
40 override void EOnFrame(IEntity owner,
float timeSlice)
42 bool isDevVersion = Game.IsDev();
43 bool showWarningScreen = SplashScreen.GetGameReloads() == 0 && SplashScreen.s_iSplashShown == 1;
45 #ifdef DEBUG_WARNING_SCREEN
49 if (showWarningScreen && !isDevVersion)
55 SCR_BaseLoadingScreenComponent.ResetLoadingTime();
58 ClearEventMask(EntityEvent.ALL);
62 private void ShowWarningScreen()
64 Widget w =
GetGame().GetWorkspace().CreateWidgets(m_sSplashScreenLayout,
GetGame().GetWorkspace());
73 if (SplashScreen.s_iSplashShown == 0)
74 SplashScreen.s_iSplashShown++;
76 comp.m_OnFinished.Insert(ShowMainMenu);
80 private void ShowMainMenu()
82 GetGame().GetMenuManager().OpenMenu(m_eMenu);
84 GetGame().m_bIsMainMenuOpen =
true;