Пример #1
0
        public static void UnloadAndExitToMenu()
        {
            MyScreenManager.CloseAllScreensNowExcept(null);
            MyGuiSandbox.Update(VRage.Game.MyEngineConstants.UPDATE_STEP_SIZE_IN_MILLISECONDS);

            if (MySession.Static != null)
            {
                MySession.Static.Unload();
                MySession.Static = null;
            }

            if (MyMusicController.Static != null)
            {
                MyMusicController.Static.Unload();
                MyMusicController.Static    = null;
                MyAudio.Static.MusicAllowed = true;
            }

            if (MyMultiplayer.Static != null)
            {
                MyMultiplayer.Static.Dispose();
            }

            //  This will quit actual game-play screen and move us to fly-through with main menu on top
            MyGuiSandbox.BackToMainMenu();
        }
Пример #2
0
        public static void UnloadAndExitToMenu()
        {
            MyScreenManager.CloseAllScreensNowExcept(null);
            MyGuiSandbox.Update(MyEngineConstants.UPDATE_STEP_SIZE_IN_MILLISECONDS);

            if (MySession.Static != null)
            {
                MySession.Static.Unload();
                MySession.Static = null;
            }

            //  This will quit actual game-play screen and move us to fly-through with main menu on top
            MyGuiSandbox.BackToMainMenu();
        }
Пример #3
0
 void OnSwitchAnswer(MyGuiScreenMessageBox.ResultEnum result)
 {
     if (result == MyGuiScreenMessageBox.ResultEnum.YES)
     {
         MySandboxGame.Config.GraphicsRenderer = MySandboxGame.DirectX11RendererKey;
         MySandboxGame.Config.Save();
         MyGuiSandbox.BackToMainMenu();
         var text = MyTexts.Get(MySpaceTexts.QuickstartDX11PleaseRestartGame);
         MyGuiScreenMessageBox mb = MyGuiSandbox.CreateMessageBox(messageText: text, messageCaption: MyTexts.Get(MyCommonTexts.MessageBoxCaptionError));
         MyGuiSandbox.AddScreen(mb);
     }
     else
     {
         var text = MyTexts.Get(MySpaceTexts.QuickstartSelectDifferent);
         MyGuiScreenMessageBox mb = MyGuiSandbox.CreateMessageBox(messageText: text, messageCaption: MyTexts.Get(MyCommonTexts.MessageBoxCaptionError));
         MyGuiSandbox.AddScreen(mb);
     }
 }
Пример #4
0
 void OnPleaseRestart(MyGuiScreenMessageBox.ResultEnum result)
 {
     MyGuiSandbox.BackToMainMenu();
 }