1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 09:22:54 +08:00

Fix leaderboard fadeout causing constant flow changes

Also cleans up logic significantly.
This commit is contained in:
Dean Herbert 2017-11-19 00:53:59 +09:00
parent 7046d0a675
commit 9325730f5d

View File

@ -40,20 +40,12 @@ namespace osu.Game.Screens.Select.Leaderboards
scores = value; scores = value;
getScoresRequest?.Cancel(); getScoresRequest?.Cancel();
int i = 150; scrollFlow?.FadeOut(200);
scrollFlow?.Expire();
scrollFlow = null;
if (scores == null) if (scores == null)
{
if (scrollFlow != null)
{
foreach (var c in scrollFlow.Children)
c.FadeOut(i += 10);
foreach (var c in scrollFlow.Children)
c.LifetimeEnd = Time.Current + i;
}
return; return;
}
// schedule because we may not be loaded yet (LoadComponentAsync complains). // schedule because we may not be loaded yet (LoadComponentAsync complains).
Schedule(() => Schedule(() =>
@ -67,10 +59,9 @@ namespace osu.Game.Screens.Select.Leaderboards
ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) }) ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) })
}, f => }, f =>
{ {
scrollFlow?.Expire();
scrollContainer.Add(scrollFlow = f); scrollContainer.Add(scrollFlow = f);
i = 0; int i = 0;
foreach (var s in f.Children) foreach (var s in f.Children)
{ {
using (s.BeginDelayedSequence(i++ * 50, true)) using (s.BeginDelayedSequence(i++ * 50, true))