/// <summary> /// Handles exiting the screen if the user has no pause on. /// </summary> private void HandleQuickExit() { if (InReplayMode && !Failed && !IsPlayComplete || Exiting) { return; } TimesRequestedToPause++; // Force fail the user if they request to quit more than once. switch (TimesRequestedToPause) { case 1: NotificationManager.Show(NotificationLevel.Warning, "Press the exit button once more to quit."); break; default: var game = GameBase.Game as QuaverGame; var cursor = game?.GlobalUserInterface.Cursor; cursor.Alpha = 1; if (IsMultiplayerGame) { Exit(() => { OnlineManager.LeaveGame(); return(new LobbyScreen()); }); return; } ForceFail = true; HasQuit = true; var view = (GameplayScreenView)View; view.Transitioner.Animations.Clear(); break; } }
/// <summary> /// </summary> public void LeaveGame() => Exit(() => { OnlineManager.LeaveGame(); return(new LobbyScreen()); });