From 6ab9ee76b7306dd5a1a28ab53c67bc24ade82b42 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Jun 2025 23:20:38 +0900 Subject: [PATCH 1/2] Use equality when updated current carousel selection --- osu.Game/Graphics/Carousel/Carousel.cs | 4 ++-- osu.Game/Screens/SelectV2/BeatmapCarousel.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Carousel/Carousel.cs b/osu.Game/Graphics/Carousel/Carousel.cs index 22167350cf..552b7652f6 100644 --- a/osu.Game/Graphics/Carousel/Carousel.cs +++ b/osu.Game/Graphics/Carousel/Carousel.cs @@ -108,7 +108,7 @@ namespace osu.Game.Graphics.Carousel get => currentSelection.Model; set { - if (currentSelection.Model != value) + if (!CheckModelEquality(currentSelection.Model, value)) { HandleItemSelected(value); @@ -210,7 +210,7 @@ namespace osu.Game.Graphics.Carousel /// /// Check whether two models are the same for display purposes. /// - protected virtual bool CheckModelEquality(object x, object y) => ReferenceEquals(x, y); + protected virtual bool CheckModelEquality(object? x, object? y) => ReferenceEquals(x, y); /// /// Create a drawable for the given carousel item so it can be displayed. diff --git a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs index 700ee6a05e..1bd2ff4746 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs @@ -553,7 +553,7 @@ namespace osu.Game.Screens.SelectV2 AddInternal(setPanelPool); } - protected override bool CheckModelEquality(object x, object y) + protected override bool CheckModelEquality(object? x, object? y) { // In the confines of the carousel logic, we assume that CurrentSelection (and all items) are using non-stale // BeatmapInfo reference, and that we can match based on beatmap / beatmapset (GU)IDs. From ed2889c9839fa6599dd5268d0bc2dc0313074f54 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Jun 2025 23:30:36 +0900 Subject: [PATCH 2/2] Fix clicking beatmap header causing leaderboard to refresh --- osu.Game/Screens/SelectV2/SongSelect.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 43c554f8d8..033f9e9c78 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -447,7 +447,13 @@ namespace osu.Game.Screens.SelectV2 // Debounce consideration is to avoid beatmap churn on key repeat selection. selectionDebounce?.Cancel(); - selectionDebounce = Scheduler.AddDelayed(() => Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap), SELECTION_DEBOUNCE); + selectionDebounce = Scheduler.AddDelayed(() => + { + if (Beatmap.Value.BeatmapInfo.Equals(beatmap)) + return; + + Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap); + }, SELECTION_DEBOUNCE); } private bool ensureGlobalBeatmapValid()