mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 18:27:19 +08:00
Improve legibility of NoScroesPlaceholder
This commit is contained in:
parent
16bdf4e6bd
commit
dad2e5c678
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user