From d765b7e233d3d2bd826541022d512182d073635d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 May 2025 00:49:24 +0900 Subject: [PATCH 1/4] Add missing current screen check I don't understand why stuff that was present in v1 wasn't carried across to v2 rather than waiting until stuff breaks a second time to fix it. --- osu.Game/Screens/SelectV2/SongSelect.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 962c11f345..dde17997ad 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -469,7 +469,8 @@ namespace osu.Game.Screens.SelectV2 logo.Action = () => { - OnStart(); + if (this.IsCurrentScreen()) + OnStart(); return false; }; } From 4335b51edcbcf938aa2a883c4998619b9d5758b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 May 2025 00:51:12 +0900 Subject: [PATCH 2/4] Simplify logo tracking logic since we never have more than one logo --- .../Containers/LogoTrackingContainer.cs | 18 +++++++----------- osu.Game/Screens/Menu/MainMenu.cs | 17 +++-------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/osu.Game/Graphics/Containers/LogoTrackingContainer.cs b/osu.Game/Graphics/Containers/LogoTrackingContainer.cs index 13c672cbd6..6819d97bc5 100644 --- a/osu.Game/Graphics/Containers/LogoTrackingContainer.cs +++ b/osu.Game/Graphics/Containers/LogoTrackingContainer.cs @@ -34,17 +34,14 @@ namespace osu.Game.Graphics.Containers /// The easing type of the initial transform. 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 /// public void StopTracking() { - if (Logo != null) - { - Logo.IsTracking = false; - Logo = null; - } + if (Logo == null) return; + + Logo.IsTracking = false; + Logo = null; } /// diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index fba321d128..2d7981113b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -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) From 68d557b4ada24ddf1b8a4c4b055755cc8d9239d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 May 2025 01:13:12 +0900 Subject: [PATCH 3/4] Fix logo transitions with song select v2 --- osu.Game/Screens/SelectV2/SongSelect.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index dde17997ad..ce3bcd3c1a 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -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 { @@ -484,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); } From eea5a2f89362eb8b14dfff10caf65ab0235d4131 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 27 May 2025 01:29:30 +0900 Subject: [PATCH 4/4] Fix logo animations being interrupted incorrectly --- osu.Game/Screens/SelectV2/SongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index ce3bcd3c1a..d7dad86600 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -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()