mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Add specific placeholder message for custom rulesets rather than showing network error
This commit is contained in:
parent
09a74cdfc6
commit
c342030b2c
@ -119,7 +119,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddStep(@"Network failure", () => leaderboard.SetErrorState(LeaderboardState.NetworkFailure));
|
||||
AddStep(@"No supporter", () => leaderboard.SetErrorState(LeaderboardState.NotSupporter));
|
||||
AddStep(@"Not logged in", () => leaderboard.SetErrorState(LeaderboardState.NotLoggedIn));
|
||||
AddStep(@"Unavailable", () => leaderboard.SetErrorState(LeaderboardState.Unavailable));
|
||||
AddStep(@"Ruleset unavailable", () => leaderboard.SetErrorState(LeaderboardState.RulesetUnavailable));
|
||||
AddStep(@"Beatmap unavailable", () => leaderboard.SetErrorState(LeaderboardState.BeatmapUnavailable));
|
||||
AddStep(@"None selected", () => leaderboard.SetErrorState(LeaderboardState.NoneSelected));
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,10 @@ namespace osu.Game.Online.Leaderboards
|
||||
case LeaderboardState.NoneSelected:
|
||||
return new MessagePlaceholder(@"Please select a beatmap!");
|
||||
|
||||
case LeaderboardState.Unavailable:
|
||||
case LeaderboardState.RulesetUnavailable:
|
||||
return new MessagePlaceholder(@"Leaderboards are not available for this ruleset!");
|
||||
|
||||
case LeaderboardState.BeatmapUnavailable:
|
||||
return new MessagePlaceholder(@"Leaderboards are not available for this beatmap!");
|
||||
|
||||
case LeaderboardState.NoScores:
|
||||
|
@ -8,7 +8,8 @@ namespace osu.Game.Online.Leaderboards
|
||||
Success,
|
||||
Retrieving,
|
||||
NetworkFailure,
|
||||
Unavailable,
|
||||
BeatmapUnavailable,
|
||||
RulesetUnavailable,
|
||||
NoneSelected,
|
||||
NoScores,
|
||||
NotLoggedIn,
|
||||
|
@ -98,6 +98,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
protected override APIRequest FetchScores(CancellationToken cancellationToken)
|
||||
{
|
||||
var fetchBeatmapInfo = BeatmapInfo;
|
||||
var fetchRuleset = ruleset.Value ?? fetchBeatmapInfo.Ruleset;
|
||||
|
||||
if (fetchBeatmapInfo == null)
|
||||
{
|
||||
@ -117,9 +118,15 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
return null;
|
||||
}
|
||||
|
||||
if (fetchRuleset.OnlineID <= 0 || fetchRuleset.OnlineID > ILegacyRuleset.MAX_LEGACY_RULESET_ID)
|
||||
{
|
||||
SetErrorState(LeaderboardState.RulesetUnavailable);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (fetchBeatmapInfo.OnlineID <= 0 || fetchBeatmapInfo.Status <= BeatmapOnlineStatus.Pending)
|
||||
{
|
||||
SetErrorState(LeaderboardState.Unavailable);
|
||||
SetErrorState(LeaderboardState.BeatmapUnavailable);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -137,7 +144,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
else if (filterMods)
|
||||
requestMods = mods.Value;
|
||||
|
||||
var req = new GetScoresRequest(fetchBeatmapInfo, ruleset.Value ?? fetchBeatmapInfo.Ruleset, Scope, requestMods);
|
||||
var req = new GetScoresRequest(fetchBeatmapInfo, fetchRuleset, Scope, requestMods);
|
||||
|
||||
req.Success += r =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user