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
1 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,8 @@ public class Leaderboard : Container
private ScheduledDelegate showScoresDelegate;
private bool scoresLoadedOnce;
private IEnumerable<Score> scores;
public IEnumerable<Score> Scores
{
@ -48,6 +50,8 @@ public IEnumerable<Score> Scores
{
scores = value;
scoresLoadedOnce = true;
scrollFlow?.FadeOut(fade_duration, Easing.OutQuint).Expire();
scrollFlow = null;
@ -227,6 +231,10 @@ private void handleApiStateChange(APIState oldState, APIState newState)
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 = null;