mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Reduce complexity of selection restore
This commit is contained in:
parent
9e94f38091
commit
89eeff515b
@ -134,8 +134,7 @@ namespace osu.Game.Screens.Select
|
||||
if (selectedBeatmapSet != null && !originalBeatmapSetsDetached.Contains(selectedBeatmapSet.BeatmapSet))
|
||||
selectedBeatmapSet = null;
|
||||
|
||||
var selectedSetBefore = selectedBeatmapSet;
|
||||
var selectedBeatmapBefore = selectedBeatmap;
|
||||
var selectedBeatmapBefore = selectedBeatmap?.BeatmapInfo;
|
||||
|
||||
CarouselRoot newRoot = new CarouselRoot(this);
|
||||
|
||||
@ -170,9 +169,9 @@ namespace osu.Game.Screens.Select
|
||||
signalBeatmapsLoaded();
|
||||
|
||||
// Restore selection
|
||||
if (selectedBeatmapBefore != null && selectedSetBefore != null && newRoot.BeatmapSetsByID.TryGetValue(selectedSetBefore.BeatmapSet.ID, out var newSelectionCandidates))
|
||||
if (selectedBeatmapBefore != null && newRoot.BeatmapSetsByID.TryGetValue(selectedBeatmapBefore.BeatmapSet!.ID, out var newSelectionCandidates))
|
||||
{
|
||||
CarouselBeatmap? found = newSelectionCandidates.SelectMany(s => s.Beatmaps).SingleOrDefault(b => b.BeatmapInfo.ID == selectedBeatmapBefore.BeatmapInfo.ID);
|
||||
CarouselBeatmap? found = newSelectionCandidates.SelectMany(s => s.Beatmaps).SingleOrDefault(b => b.BeatmapInfo.ID == selectedBeatmapBefore.ID);
|
||||
|
||||
if (found != null)
|
||||
found.State.Value = CarouselItemState.Selected;
|
||||
|
Loading…
Reference in New Issue
Block a user