From e61ae7ab8a0e68dafb83d43575770ea8c3bc4206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 27 Oct 2025 11:06:38 +0100 Subject: [PATCH] Fix single filtered selection not being reselected after being filtered away Closes https://github.com/ppy/osu/issues/35003. Bit dodgy to use `CurrentSelectionItem` for this. Ideally I would use the global `Beatmap.IsDefault`, but I kind of don't want to violate the rule that `BeatmapCarousel` shouldn't have direct access to the global beatmap. And this seems to work, so... maybe fine to use until it doesn't? --- osu.Game/Screens/SelectV2/BeatmapCarousel.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs index d6bd9c1db1..5e84ba0722 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs @@ -561,8 +561,19 @@ namespace osu.Game.Screens.SelectV2 var beatmaps = items.Select(i => i.Model).OfType(); - if (beatmaps.Any(b => b.Equals(CurrentSelection as GroupedBeatmap))) + // do not request recommended selection if the user already had selected a difficulty within the single filtered beatmap set, + // as it could change the difficulty that will be selected + var preexistingSelection = beatmaps.FirstOrDefault(b => b.Equals(CurrentSelection as GroupedBeatmap)); + + if (preexistingSelection != null) + { + // the selection might not have an item associated with it, if it was fully filtered away previously + // in this case, request to reselect it + if (CurrentSelectionItem == null) + RequestSelection(preexistingSelection); + return; + } RequestRecommendedSelection(beatmaps); }