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(); }
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(); }
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); } }
void OnPleaseRestart(MyGuiScreenMessageBox.ResultEnum result) { MyGuiSandbox.BackToMainMenu(); }