1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 12:43:16 +08:00

Fix current selection not being correctly maintained when BeatmapPicker updates its display

This commit is contained in:
Dean Herbert 2022-02-22 17:14:00 +09:00
parent 5efffa208a
commit 6de4e05e49

View File

@ -183,7 +183,14 @@ namespace osu.Game.Overlays.BeatmapSet
}
starRatingContainer.FadeOut(100);
Beatmap.Value = Difficulties.FirstOrDefault()?.Beatmap;
// If a selection is already made, try and maintain it.
if (Beatmap.Value != null)
Beatmap.Value = Difficulties.FirstOrDefault(b => b.Beatmap.OnlineID == Beatmap.Value.OnlineID)?.Beatmap;
// Else just choose the first available difficulty for now.
Beatmap.Value ??= Difficulties.FirstOrDefault()?.Beatmap;
plays.Value = BeatmapSet?.PlayCount ?? 0;
favourites.Value = BeatmapSet?.FavouriteCount ?? 0;