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. 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()