mirror of
https://github.com/ppy/osu.git
synced 2026-05-24 19:50:38 +08:00
Merge pull request #33268 from peppy/song-select-v2-logo-fix
SongSelectV2: Fix multiple issues with osu! logo animations
This commit is contained in:
@@ -34,17 +34,14 @@ namespace osu.Game.Graphics.Containers
|
||||
/// <param name="easing">The easing type of the initial transform.</param>
|
||||
public void StartTracking(OsuLogo logo, double duration = 0, Easing easing = Easing.None)
|
||||
{
|
||||
if (Logo != null && Logo != logo)
|
||||
throw new InvalidOperationException("A different logo is already being tracked.");
|
||||
|
||||
ArgumentNullException.ThrowIfNull(logo);
|
||||
|
||||
if (logo.IsTracking && Logo == null)
|
||||
throw new InvalidOperationException($"Cannot track an instance of {typeof(OsuLogo)} to multiple {typeof(LogoTrackingContainer)}s");
|
||||
|
||||
if (Logo != logo && Logo != null)
|
||||
{
|
||||
// If we're replacing the logo to be tracked, the old one no longer has a tracking container
|
||||
Logo.IsTracking = false;
|
||||
}
|
||||
|
||||
Logo = logo;
|
||||
Logo.IsTracking = true;
|
||||
|
||||
@@ -60,11 +57,10 @@ namespace osu.Game.Graphics.Containers
|
||||
/// </summary>
|
||||
public void StopTracking()
|
||||
{
|
||||
if (Logo != null)
|
||||
{
|
||||
Logo.IsTracking = false;
|
||||
Logo = null;
|
||||
}
|
||||
if (Logo == null) return;
|
||||
|
||||
Logo.IsTracking = false;
|
||||
Logo = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -269,9 +269,6 @@ namespace osu.Game.Screens.Menu
|
||||
dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error));
|
||||
}
|
||||
|
||||
[CanBeNull]
|
||||
private Drawable proxiedLogo;
|
||||
|
||||
[CanBeNull]
|
||||
private ScheduledDelegate mobileDisclaimerSchedule;
|
||||
|
||||
@@ -284,7 +281,7 @@ namespace osu.Game.Screens.Menu
|
||||
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
|
||||
logo.FadeIn(100, Easing.OutQuint);
|
||||
|
||||
proxiedLogo = logo.ProxyToContainer(logoTarget);
|
||||
logo.ProxyToContainer(logoTarget);
|
||||
|
||||
if (resuming)
|
||||
{
|
||||
@@ -343,11 +340,7 @@ namespace osu.Game.Screens.Menu
|
||||
var seq = logo.FadeOut(300, Easing.InSine)
|
||||
.ScaleTo(0.2f, 300, Easing.InSine);
|
||||
|
||||
if (proxiedLogo != null)
|
||||
{
|
||||
logo.ReturnProxy();
|
||||
proxiedLogo = null;
|
||||
}
|
||||
logo.ReturnProxy();
|
||||
|
||||
seq.OnComplete(_ => Buttons.SetOsuLogo(null));
|
||||
seq.OnAbort(_ => Buttons.SetOsuLogo(null));
|
||||
@@ -357,11 +350,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
base.LogoExiting(logo);
|
||||
|
||||
if (proxiedLogo != null)
|
||||
{
|
||||
logo.ReturnProxy();
|
||||
proxiedLogo = null;
|
||||
}
|
||||
logo.ReturnProxy();
|
||||
}
|
||||
|
||||
public override void OnSuspending(ScreenTransitionEvent e)
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
logo?.ScaleTo(v.NewValue == Visibility.Visible ? 0f : logo_scale, 400, Easing.OutQuint)
|
||||
.FadeTo(v.NewValue == Visibility.Visible ? 0f : 1f, 200, Easing.OutQuint);
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
@@ -455,7 +455,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
base.LogoArriving(logo, resuming);
|
||||
|
||||
if (logo.Alpha > 0.8f)
|
||||
if (logo.Alpha > 0.8f && resuming)
|
||||
Footer?.StartTrackingLogo(logo, 400, Easing.OutQuint);
|
||||
else
|
||||
{
|
||||
@@ -469,7 +469,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
|
||||
logo.Action = () =>
|
||||
{
|
||||
OnStart();
|
||||
if (this.IsCurrentScreen())
|
||||
OnStart();
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@@ -483,7 +484,9 @@ namespace osu.Game.Screens.SelectV2
|
||||
protected override void LogoExiting(OsuLogo logo)
|
||||
{
|
||||
base.LogoExiting(logo);
|
||||
Scheduler.AddDelayed(() => Footer?.StopTrackingLogo(), 120);
|
||||
|
||||
Footer?.StopTrackingLogo();
|
||||
|
||||
logo.ScaleTo(0.2f, 120, Easing.Out);
|
||||
logo.FadeOut(120, Easing.Out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user