mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09: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;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapSet.Scores
|
namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||||
{
|
{
|
||||||
@ -16,27 +16,30 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
public NoScoresPlaceholder()
|
public NoScoresPlaceholder()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Child = text = new SpriteText
|
Child = text = new OsuSpriteText();
|
||||||
{
|
|
||||||
Font = OsuFont.GetFont(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
switch (scope)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
text.Text = @"No scores have been set yet. Maybe you can be the first!";
|
text.Text = @"No scores have been set yet. Maybe you can be the first!";
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case BeatmapLeaderboardScope.Friend:
|
case BeatmapLeaderboardScope.Friend:
|
||||||
text.Text = @"None of your friends have set a score on this map yet.";
|
text.Text = @"None of your friends have set a score on this map yet.";
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case BeatmapLeaderboardScope.Country:
|
case BeatmapLeaderboardScope.Country:
|
||||||
text.Text = @"No one from your country has set a score on this map yet.";
|
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
|
public class ScoresContainer : CompositeDrawable
|
||||||
{
|
{
|
||||||
private const int spacing = 15;
|
private const int spacing = 15;
|
||||||
private const int duration = 200;
|
|
||||||
|
|
||||||
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
@ -215,7 +214,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
getScoresRequest?.Cancel();
|
getScoresRequest?.Cancel();
|
||||||
getScoresRequest = null;
|
getScoresRequest = null;
|
||||||
|
|
||||||
noScoresPlaceholder.FadeOut(duration, Easing.OutQuint);
|
noScoresPlaceholder.Hide();
|
||||||
|
|
||||||
if (Beatmap.Value?.OnlineBeatmapID.HasValue != true || Beatmap.Value.Status <= BeatmapSetOnlineStatus.Pending)
|
if (Beatmap.Value?.OnlineBeatmapID.HasValue != true || Beatmap.Value.Status <= BeatmapSetOnlineStatus.Pending)
|
||||||
{
|
{
|
||||||
@ -233,10 +232,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Scores = scores;
|
Scores = scores;
|
||||||
|
|
||||||
if (!scores.Scores.Any())
|
if (!scores.Scores.Any())
|
||||||
{
|
noScoresPlaceholder.ShowWithScope(scope.Value);
|
||||||
noScoresPlaceholder.UpdateText(scope.Value);
|
|
||||||
noScoresPlaceholder.FadeIn(duration, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
api.Queue(getScoresRequest);
|
api.Queue(getScoresRequest);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user