mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 22:22:55 +08:00
Load each tournament banner as soon as it is loaded
This commit is contained in:
parent
af10dbb76c
commit
984c30ded6
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// 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.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -47,7 +46,15 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
LoadComponentsAsync(banners.Select(b => new DrawableTournamentBanner(b)), AddRangeInternal, cancellationTokenSource.Token);
|
for (int index = 0; index < banners.Length; index++)
|
||||||
|
{
|
||||||
|
int displayIndex = index;
|
||||||
|
LoadComponentAsync(new DrawableTournamentBanner(banners[index]), asyncBanner =>
|
||||||
|
{
|
||||||
|
// load in stable order regardless of async load order.
|
||||||
|
Insert(displayIndex, asyncBanner);
|
||||||
|
}, cancellationTokenSource.Token);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user