diff --git a/osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs b/osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs index 9cfce4ef5b..391ba93a4b 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/NoScoresPlaceholder.cs @@ -3,9 +3,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Graphics; using osu.Game.Screens.Select.Leaderboards; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.BeatmapSet.Scores { @@ -16,27 +16,30 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public NoScoresPlaceholder() { AutoSizeAxes = Axes.Both; - Child = text = new SpriteText - { - Font = OsuFont.GetFont(), - }; + Child = text = new OsuSpriteText(); } - public void UpdateText(BeatmapLeaderboardScope scope) + public override void Show() => this.FadeIn(200, Easing.OutQuint); + + public override void Hide() => this.FadeOut(200, Easing.OutQuint); + + public void ShowWithScope(BeatmapLeaderboardScope scope) { + Show(); + switch (scope) { default: text.Text = @"No scores have been set yet. Maybe you can be the first!"; - return; + break; case BeatmapLeaderboardScope.Friend: text.Text = @"None of your friends have set a score on this map yet."; - return; + break; case BeatmapLeaderboardScope.Country: text.Text = @"No one from your country has set a score on this map yet."; - return; + break; } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index ac39671f56..86fb455eb8 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -23,7 +23,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public class ScoresContainer : CompositeDrawable { private const int spacing = 15; - private const int duration = 200; public readonly Bindable Beatmap = new Bindable(); private readonly Bindable ruleset = new Bindable(); @@ -215,7 +214,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores getScoresRequest?.Cancel(); getScoresRequest = null; - noScoresPlaceholder.FadeOut(duration, Easing.OutQuint); + noScoresPlaceholder.Hide(); if (Beatmap.Value?.OnlineBeatmapID.HasValue != true || Beatmap.Value.Status <= BeatmapSetOnlineStatus.Pending) { @@ -233,10 +232,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Scores = scores; if (!scores.Scores.Any()) - { - noScoresPlaceholder.UpdateText(scope.Value); - noScoresPlaceholder.FadeIn(duration, Easing.OutQuint); - } + noScoresPlaceholder.ShowWithScope(scope.Value); }; api.Queue(getScoresRequest); }