1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 03:31:23 +08:00

Avoid performing eager selection constantly on adding ranges of new children

This commit is contained in:
Dean Herbert
2020-10-12 15:36:26 +09:00
Unverified
parent 0a978c6131
commit f3b24b9bb5
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select
{
CarouselRoot newRoot = new CarouselRoot(this);
beatmapSets.Select(createCarouselSet).Where(g => g != null).ForEach(newRoot.AddChild);
newRoot.AddChildren(beatmapSets.Select(createCarouselSet).Where(g => g != null));
root = newRoot;
if (selectedBeatmapSet != null && !beatmapSets.Contains(selectedBeatmapSet.BeatmapSet))
@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Screens.Select.Carousel
@@ -54,6 +55,14 @@ namespace osu.Game.Screens.Select.Carousel
updateSelectedIndex();
}
public void AddChildren(IEnumerable<CarouselItem> items)
{
foreach (var i in items)
base.AddChild(i);
attemptSelection();
}
public override void AddChild(CarouselItem i)
{
base.AddChild(i);