diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 231115d1e1..8437748d9d 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Linq; using osuTK; using osuTK.Graphics; using osu.Framework.Allocation; @@ -132,6 +133,8 @@ namespace osu.Game.Screens.Menu private void confirmAndExit() { + if (exitConfirmed) return; + exitConfirmed = true; this.Exit(); } @@ -250,6 +253,12 @@ namespace osu.Game.Screens.Menu return true; } + if (dialogOverlay.CurrentDialog is ConfirmExitDialog) + { + exitConfirmed = true; + dialogOverlay.CurrentDialog.Buttons.First().Click(); + } + buttons.State = ButtonSystemState.Exit; this.FadeOut(3000); return base.OnExiting(next);