mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Fix incorrect handling when new beatmaps arrive
This commit is contained in:
parent
2b1c6ae612
commit
ecbf0f138e
@ -393,7 +393,6 @@ namespace osu.Game.Screens.Select
|
||||
if (selectedBeatmapSet?.BeatmapSet.ID == beatmapSet.ID)
|
||||
previouslySelectedID = selectedBeatmap?.BeatmapInfo.ID;
|
||||
|
||||
var newSet = createCarouselSet(beatmapSet);
|
||||
var removedSets = root.RemoveChild(beatmapSet.ID);
|
||||
|
||||
foreach (var removedSet in removedSets)
|
||||
@ -405,13 +404,37 @@ namespace osu.Game.Screens.Select
|
||||
expirePanelImmediately(removedDrawable);
|
||||
}
|
||||
|
||||
if (newSet != null)
|
||||
if (beatmapsSplitOut)
|
||||
{
|
||||
root.AddItem(newSet);
|
||||
foreach (var beatmap in beatmapSet.Beatmaps)
|
||||
{
|
||||
var newSet = createCarouselSet(new BeatmapSetInfo(new[] { beatmap })
|
||||
{
|
||||
ID = beatmapSet.ID
|
||||
});
|
||||
|
||||
// check if we can/need to maintain our current selection.
|
||||
if (previouslySelectedID != null)
|
||||
select((CarouselItem?)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet);
|
||||
if (newSet != null)
|
||||
{
|
||||
root.AddItem(newSet);
|
||||
|
||||
// check if we can/need to maintain our current selection.
|
||||
if (previouslySelectedID != null)
|
||||
select((CarouselItem?)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var newSet = createCarouselSet(beatmapSet);
|
||||
|
||||
if (newSet != null)
|
||||
{
|
||||
root.AddItem(newSet);
|
||||
|
||||
// check if we can/need to maintain our current selection.
|
||||
if (previouslySelectedID != null)
|
||||
select((CarouselItem?)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet);
|
||||
}
|
||||
}
|
||||
|
||||
itemsCache.Invalidate();
|
||||
|
Loading…
Reference in New Issue
Block a user