1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:33:20 +08:00

Fix loading animation is no longer present for scores in Beatma… (#5401)

Fix loading animation is no longer present for scores in BeatmapSetOverlay

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-07-20 23:10:29 +09:00 committed by GitHub
commit 2ff7979d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
public class ScoresContainer : CompositeDrawable
{
private const int spacing = 15;
private const int fade_duration = 200;
private readonly Box background;
private readonly ScoreTable scoreTable;
@ -53,8 +52,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
Schedule(() =>
{
loading = false;
topScoresContainer.Clear();
if (value?.Scores.Any() != true)
@ -128,11 +125,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
background.Colour = colours.Gray2;
}
private bool loading
{
set => loadingAnimation.FadeTo(value ? 1 : 0, fade_duration);
}
private void getScores(BeatmapInfo beatmap)
{
getScoresRequest?.Cancel();
@ -141,15 +133,16 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Scores = null;
if (beatmap?.OnlineBeatmapID.HasValue != true)
{
loading = false;
return;
}
loadingAnimation.Show();
getScoresRequest = new GetScoresRequest(beatmap, beatmap.Ruleset);
getScoresRequest.Success += scores => Scores = scores;
getScoresRequest.Success += scores =>
{
loadingAnimation.Hide();
Scores = scores;
};
api.Queue(getScoresRequest);
loading = true;
}
}
}