Fix leaderboard showing placeholder briefly when entering song select

This commit is contained in:
Dean Herbert 2018-07-01 18:17:02 +09:00
parent 109649aa52
commit 2c597874bf

View File

@ -40,6 +40,8 @@ namespace osu.Game.Screens.Select.Leaderboards
private ScheduledDelegate showScoresDelegate; private ScheduledDelegate showScoresDelegate;
private bool scoresLoadedOnce;
private IEnumerable<Score> scores; private IEnumerable<Score> scores;
public IEnumerable<Score> Scores public IEnumerable<Score> Scores
{ {
@ -48,6 +50,8 @@ namespace osu.Game.Screens.Select.Leaderboards
{ {
scores = value; scores = value;
scoresLoadedOnce = true;
scrollFlow?.FadeOut(fade_duration, Easing.OutQuint).Expire(); scrollFlow?.FadeOut(fade_duration, Easing.OutQuint).Expire();
scrollFlow = null; scrollFlow = null;
@ -227,6 +231,10 @@ namespace osu.Game.Screens.Select.Leaderboards
private void updateScores() private void updateScores()
{ {
// don't display any scores or placeholder until the first Scores_Set has been called.
// this avoids scope changes flickering a "no scores" placeholder before initialisation of song select is finished.
if (!scoresLoadedOnce) return;
getScoresRequest?.Cancel(); getScoresRequest?.Cancel();
getScoresRequest = null; getScoresRequest = null;