1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 03:13:21 +08:00

Consume updated logic at MainMenu

This commit is contained in:
Dean Herbert 2021-05-19 16:27:38 +09:00
parent 124ac689b8
commit b83322281e

View File

@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -22,6 +19,8 @@ using osu.Game.Screens.Edit;
using osu.Game.Screens.OnlinePlay.Multiplayer; using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Screens.OnlinePlay.Playlists; using osu.Game.Screens.OnlinePlay.Playlists;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Menu namespace osu.Game.Screens.Menu
{ {
@ -120,7 +119,7 @@ namespace osu.Game.Screens.Menu
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Margin = new MarginPadding { Right = 15, Top = 5 } Margin = new MarginPadding { Right = 15, Top = 5 }
}, },
exitConfirmOverlay?.CreateProxy() ?? Drawable.Empty() exitConfirmOverlay?.CreateProxy() ?? Empty()
}); });
buttons.StateChanged += state => buttons.StateChanged += state =>
@ -270,16 +269,12 @@ namespace osu.Game.Screens.Menu
if (!exitConfirmed && dialogOverlay != null) if (!exitConfirmed && dialogOverlay != null)
{ {
if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog) if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog)
{ exitDialog.PerformOkAction();
exitConfirmed = true;
exitDialog.Buttons.First().Click();
}
else else
{
dialogOverlay.Push(new ConfirmExitDialog(confirmAndExit, () => exitConfirmOverlay.Abort())); dialogOverlay.Push(new ConfirmExitDialog(confirmAndExit, () => exitConfirmOverlay.Abort()));
return true; return true;
} }
}
buttons.State = ButtonSystemState.Exit; buttons.State = ButtonSystemState.Exit;
OverlayActivationMode.Value = OverlayActivation.Disabled; OverlayActivationMode.Value = OverlayActivation.Disabled;