1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 17:02:58 +08:00

Simplify toolbar hiding logic in FirstRunSetupOverlay

Rather than fiddling around with the activation modes, this seems like a
much cleaner way to make things work.

Closes https://github.com/ppy/osu/issues/18277.
This commit is contained in:
Dean Herbert 2022-05-19 16:42:43 +09:00
parent 16075d2a2f
commit 363e7a6f53
2 changed files with 5 additions and 19 deletions

View File

@ -62,8 +62,6 @@ namespace osu.Game.Overlays
private Container screenContent = null!; private Container screenContent = null!;
private Bindable<OverlayActivation>? overlayActivationMode;
private Container content = null!; private Container content = null!;
private LoadingSpinner loading = null!; private LoadingSpinner loading = null!;
@ -225,16 +223,9 @@ namespace osu.Game.Overlays
// if we are valid for display, only do so after reaching the main menu. // if we are valid for display, only do so after reaching the main menu.
performer.PerformFromScreen(screen => performer.PerformFromScreen(screen =>
{ {
MainMenu menu = (MainMenu)screen; // Hides the toolbar for us.
if (screen is MainMenu menu)
// Eventually I'd like to replace this with a better method that doesn't access the screen. menu.ReturnToOsuLogo();
// Either this dialog would be converted to its own screen, or at very least be "hosted" by a screen pushed to the main menu.
// Alternatively, another method of disabling notifications could be added to `INotificationOverlay`.
if (menu != null)
{
overlayActivationMode = menu.OverlayActivationMode.GetBoundCopy();
overlayActivationMode.Value = OverlayActivation.UserTriggered;
}
base.Show(); base.Show();
}, new[] { typeof(MainMenu) }); }, new[] { typeof(MainMenu) });
@ -257,13 +248,6 @@ namespace osu.Game.Overlays
content.ScaleTo(0.99f, 400, Easing.OutQuint); content.ScaleTo(0.99f, 400, Easing.OutQuint);
if (overlayActivationMode != null)
{
// If this is non-null we are guaranteed to have come from the main menu.
overlayActivationMode.Value = OverlayActivation.All;
overlayActivationMode = null;
}
if (currentStepIndex != null) if (currentStepIndex != null)
{ {
notificationOverlay.Post(new SimpleNotification notificationOverlay.Post(new SimpleNotification

View File

@ -150,6 +150,8 @@ namespace osu.Game.Screens.Menu
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private IPerformFromScreenRunner performer { get; set; } private IPerformFromScreenRunner performer { get; set; }
public void ReturnToOsuLogo() => Buttons.State = ButtonSystemState.Initial;
private void confirmAndExit() private void confirmAndExit()
{ {
if (exitConfirmed) return; if (exitConfirmed) return;