From 53d7dcefe5c4d4da6c0a642bf9556e419a3cb2ce Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Thu, 5 Jan 2023 14:40:18 -0800 Subject: [PATCH 1/3] Fix osu! logo not being draggable on player loader --- osu.Game/Screens/Menu/OsuLogo.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 2d6a0736e9..7a5a26226b 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -282,7 +282,7 @@ namespace osu.Game.Screens.Menu if (beatIndex < 0) return; - if (IsHovered) + if (Action != null && IsHovered) { this.Delay(early_activation).Schedule(() => { @@ -361,11 +361,11 @@ namespace osu.Game.Screens.Menu } } - public override bool HandlePositionalInput => base.HandlePositionalInput && Action != null && Alpha > 0.2f; + public override bool HandlePositionalInput => base.HandlePositionalInput && Alpha > 0.2f; protected override bool OnMouseDown(MouseDownEvent e) { - if (e.Button != MouseButton.Left) return false; + if (Action == null || e.Button != MouseButton.Left) return false; logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out); return true; @@ -380,7 +380,9 @@ namespace osu.Game.Screens.Menu protected override bool OnClick(ClickEvent e) { - if (Action?.Invoke() ?? true) + if (Action == null) return false; + + if (Action.Invoke()) sampleClick.Play(); flashLayer.ClearTransforms(); @@ -391,6 +393,8 @@ namespace osu.Game.Screens.Menu protected override bool OnHover(HoverEvent e) { + if (Action == null) return false; + logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); return true; } From bae3a6851bf256040aad4f4ab07af15437aec0ca Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 7 Jan 2023 11:15:51 -0800 Subject: [PATCH 2/3] Block hover events behind logo even if action is null --- osu.Game/Screens/Menu/OsuLogo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 7a5a26226b..e95d0384ba 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -393,7 +393,7 @@ namespace osu.Game.Screens.Menu protected override bool OnHover(HoverEvent e) { - if (Action == null) return false; + if (Action == null) return true; logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); return true; From 750b55d9b7101e22473249688c7ff41d4971abb0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 8 Jan 2023 22:28:19 +0900 Subject: [PATCH 3/3] Update other events to have matching return types (and animate more) --- osu.Game/Screens/Menu/OsuLogo.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index e95d0384ba..9430a1cda8 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -365,7 +365,7 @@ namespace osu.Game.Screens.Menu protected override bool OnMouseDown(MouseDownEvent e) { - if (Action == null || e.Button != MouseButton.Left) return false; + if (e.Button != MouseButton.Left) return true; logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out); return true; @@ -380,22 +380,21 @@ namespace osu.Game.Screens.Menu protected override bool OnClick(ClickEvent e) { - if (Action == null) return false; - - if (Action.Invoke()) - sampleClick.Play(); - flashLayer.ClearTransforms(); flashLayer.Alpha = 0.4f; flashLayer.FadeOut(1500, Easing.OutExpo); + + if (Action?.Invoke() == true) + sampleClick.Play(); + return true; } protected override bool OnHover(HoverEvent e) { - if (Action == null) return true; + if (Action != null) + logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); - logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); return true; }