1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Merge pull request #24424 from bdach/exit-logo-hide

Fix osu! logo suddenly disappearing during rapid exit
This commit is contained in:
Dean Herbert 2023-07-31 17:10:49 +09:00 committed by GitHub
commit 0e59cdc771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
using System;
using System.Diagnostics;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -202,6 +203,9 @@ namespace osu.Game.Screens.Menu
dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error));
}
[CanBeNull]
private Drawable proxiedLogo;
protected override void LogoArriving(OsuLogo logo, bool resuming)
{
base.LogoArriving(logo, resuming);
@ -211,7 +215,7 @@ namespace osu.Game.Screens.Menu
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
logo.FadeIn(100, Easing.OutQuint);
logo.ProxyToContainer(logoTarget);
proxiedLogo = logo.ProxyToContainer(logoTarget);
if (resuming)
{
@ -250,12 +254,27 @@ namespace osu.Game.Screens.Menu
var seq = logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine);
logo.ReturnProxy();
if (proxiedLogo != null)
{
logo.ReturnProxy();
proxiedLogo = null;
}
seq.OnComplete(_ => Buttons.SetOsuLogo(null));
seq.OnAbort(_ => Buttons.SetOsuLogo(null));
}
protected override void LogoExiting(OsuLogo logo)
{
base.LogoExiting(logo);
if (proxiedLogo != null)
{
logo.ReturnProxy();
proxiedLogo = null;
}
}
public override void OnSuspending(ScreenTransitionEvent e)
{
base.OnSuspending(e);