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:
parent
1a871af552
commit
4f09141718
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user