mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Avoid performing eager selection constantly on adding ranges of new children
This commit is contained in:
@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
CarouselRoot newRoot = new CarouselRoot(this);
|
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;
|
root = newRoot;
|
||||||
if (selectedBeatmapSet != null && !beatmapSets.Contains(selectedBeatmapSet.BeatmapSet))
|
if (selectedBeatmapSet != null && !beatmapSets.Contains(selectedBeatmapSet.BeatmapSet))
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select.Carousel
|
namespace osu.Game.Screens.Select.Carousel
|
||||||
@ -54,6 +55,14 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
updateSelectedIndex();
|
updateSelectedIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddChildren(IEnumerable<CarouselItem> items)
|
||||||
|
{
|
||||||
|
foreach (var i in items)
|
||||||
|
base.AddChild(i);
|
||||||
|
|
||||||
|
attemptSelection();
|
||||||
|
}
|
||||||
|
|
||||||
public override void AddChild(CarouselItem i)
|
public override void AddChild(CarouselItem i)
|
||||||
{
|
{
|
||||||
base.AddChild(i);
|
base.AddChild(i);
|
||||||
|
Reference in New Issue
Block a user