1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 15:12:57 +08:00

remove extra bool

This commit is contained in:
David Zhao 2019-05-29 12:22:34 +09:00
parent 1a871af552
commit 4f09141718

View File

@ -152,15 +152,15 @@ namespace osu.Game.Screens.Select
{
Schedule(() =>
{
int? previouslySelectedID = null;
CarouselBeatmapSet existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
bool hadSelection = existingSet?.State?.Value == CarouselItemState.Selected;
// Since we're about to remove the selected beatmap, store its ID so we can go back if needed.
if (existingSet?.State?.Value == CarouselItemState.Selected)
previouslySelectedID = selectedBeatmap?.Beatmap.ID;
var newSet = createCarouselSet(beatmapSet);
// Since we're about to remove the selected beatmap, store its ID so we can go back if needed.
var previouslySelectedID = selectedBeatmap?.Beatmap.ID;
if (existingSet != null)
root.RemoveChild(existingSet);
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select
applyActiveCriteria(false, false);
//check if we can/need to maintain our current selection.
if (hadSelection)
if (previouslySelectedID != null)
select((CarouselItem)newSet.Beatmaps.FirstOrDefault(b => b.Beatmap.ID == previouslySelectedID) ?? newSet);
itemsCache.Invalidate();