mirror of
https://github.com/ppy/osu.git
synced 2024-09-22 04:07:25 +08:00
Create "none selected" placeholder state
This commit is contained in:
parent
3b650ac646
commit
a1c580f27e
@ -42,6 +42,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddStep(@"No supporter", () => leaderboard.SetRetrievalState(PlaceholderState.NotSupporter));
|
AddStep(@"No supporter", () => leaderboard.SetRetrievalState(PlaceholderState.NotSupporter));
|
||||||
AddStep(@"Not logged in", () => leaderboard.SetRetrievalState(PlaceholderState.NotLoggedIn));
|
AddStep(@"Not logged in", () => leaderboard.SetRetrievalState(PlaceholderState.NotLoggedIn));
|
||||||
AddStep(@"Unavailable", () => leaderboard.SetRetrievalState(PlaceholderState.Unavailable));
|
AddStep(@"Unavailable", () => leaderboard.SetRetrievalState(PlaceholderState.Unavailable));
|
||||||
|
AddStep(@"None selected", () => leaderboard.SetRetrievalState(PlaceholderState.NoneSelected));
|
||||||
foreach (BeatmapSetOnlineStatus status in Enum.GetValues(typeof(BeatmapSetOnlineStatus)))
|
foreach (BeatmapSetOnlineStatus status in Enum.GetValues(typeof(BeatmapSetOnlineStatus)))
|
||||||
AddStep($"{status} beatmap", () => showBeatmapWithStatus(status));
|
AddStep($"{status} beatmap", () => showBeatmapWithStatus(status));
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,10 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PlaceholderState.NoneSelected:
|
||||||
|
replacePlaceholder(new MessagePlaceholder(@"Please select a beatmap!"));
|
||||||
|
break;
|
||||||
|
|
||||||
case PlaceholderState.Unavailable:
|
case PlaceholderState.Unavailable:
|
||||||
replacePlaceholder(new MessagePlaceholder(@"Leaderboards are not available for this beatmap!"));
|
replacePlaceholder(new MessagePlaceholder(@"Leaderboards are not available for this beatmap!"));
|
||||||
break;
|
break;
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
Retrieving,
|
Retrieving,
|
||||||
NetworkFailure,
|
NetworkFailure,
|
||||||
Unavailable,
|
Unavailable,
|
||||||
|
NoneSelected,
|
||||||
NoScores,
|
NoScores,
|
||||||
NotLoggedIn,
|
NotLoggedIn,
|
||||||
NotSupporter,
|
NotSupporter,
|
||||||
|
@ -83,6 +83,12 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
|
|
||||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||||
{
|
{
|
||||||
|
if (Beatmap == null)
|
||||||
|
{
|
||||||
|
PlaceholderState = PlaceholderState.NoneSelected;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (Scope == BeatmapLeaderboardScope.Local)
|
if (Scope == BeatmapLeaderboardScope.Local)
|
||||||
{
|
{
|
||||||
var scores = scoreManager
|
var scores = scoreManager
|
||||||
@ -113,7 +119,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Beatmap?.OnlineBeatmapID == null || Beatmap?.Status <= BeatmapSetOnlineStatus.Pending)
|
if (Beatmap.OnlineBeatmapID == null || Beatmap?.Status <= BeatmapSetOnlineStatus.Pending)
|
||||||
{
|
{
|
||||||
PlaceholderState = PlaceholderState.Unavailable;
|
PlaceholderState = PlaceholderState.Unavailable;
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user