Example #1
0
        public static void StartLoading(Action loadingAction, string customLoadingBackground = null, string customLoadingtext = null)
        {
            MyAnalyticsHelper.LoadingStarted();
            var newGameplayScreen = new MyGuiScreenGamePlay();

            newGameplayScreen.OnLoadingAction += loadingAction;

            var loadScreen = new MyGuiScreenLoading(newGameplayScreen, MyGuiScreenGamePlay.Static, customLoadingBackground, customLoadingtext);

            loadScreen.OnScreenLoadingFinished += delegate
            {
                MyModAPIHelper.OnSessionLoaded();
                MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.HUDScreen));
            };
            MyGuiSandbox.AddScreen(loadScreen);
        }