1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 17:00:17 +08:00

Merge pull request #33203 from frenzibyte/carousel-select-first-visible

Fix carousel potentially selecting filtered difficulty
This commit is contained in:
Dean Herbert
2025-05-21 18:15:48 +09:00
committed by GitHub
Unverified
2 changed files with 25 additions and 2 deletions
@@ -290,5 +290,26 @@ namespace osu.Game.Tests.Visual.SongSelectV2
CheckDisplayedBeatmapsCount(local_set_count);
}
[Test]
public void TestFirstDifficultyFiltered()
{
AddBeatmaps(2, 3);
WaitForDrawablePanels();
SelectNextGroup();
WaitForSelection(0, 0);
CheckDisplayedBeatmapsCount(6);
ApplyToFilter("filter first away", c => c.UserStarDifficulty.Min = 3);
WaitForFiltering();
CheckDisplayedBeatmapsCount(4);
SelectNextGroup();
SelectPrevGroup();
WaitForSelection(0, 1);
}
}
}
+4 -2
View File
@@ -181,8 +181,10 @@ namespace osu.Game.Screens.SelectV2
return;
case BeatmapSetInfo setInfo:
// Selecting a set isn't valid let's re-select the first difficulty.
CurrentSelection = setInfo.Beatmaps.First();
// Selecting a set isn't valid let's re-select the first visible difficulty.
if (grouping.SetItems.TryGetValue(setInfo, out var items))
CurrentSelection = items.Select(i => i.Model).OfType<BeatmapInfo>().First();
return;
case BeatmapInfo beatmapInfo: