From b9220a1e293c9eef775d6606e398d012c50180dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 16 Apr 2018 17:39:55 +0900 Subject: [PATCH] Fix leaderboard placeholder sometimes disappearing indefinitely --- .../Screens/Select/Leaderboards/Leaderboard.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index a6bbbce9b9..4d8d43f60a 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -282,24 +282,29 @@ namespace osu.Game.Screens.Select.Leaderboards api.Queue(getScoresRequest); } + private Placeholder currentPlaceholder; + private void replacePlaceholder(Placeholder placeholder) { - var existingPlaceholder = placeholderContainer.Children.LastOrDefault() as Placeholder; - - if (placeholder != null && placeholder.Equals(existingPlaceholder)) + if (placeholder != null && placeholder.Equals(currentPlaceholder)) return; - existingPlaceholder?.FadeOut(150, Easing.OutQuint).Expire(); + currentPlaceholder?.FadeOut(150, Easing.OutQuint).Expire(); if (placeholder == null) + { + currentPlaceholder = null; return; + } Scores = null; - placeholderContainer.Add(placeholder); + placeholderContainer.Child = placeholder; placeholder.ScaleTo(0.8f).Then().ScaleTo(1, fade_duration * 3, Easing.OutQuint); placeholder.FadeInFromZero(fade_duration, Easing.OutQuint); + + currentPlaceholder = placeholder; } protected override void Update()