mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Fix assertions to work in both directions
This commit is contained in:
parent
d3cb910cf8
commit
d21464ea61
@ -414,6 +414,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
public void SetRetrievalState(PlaceholderState state)
|
||||
{
|
||||
Scores = null;
|
||||
PlaceholderState = state;
|
||||
}
|
||||
|
||||
|
@ -243,11 +243,10 @@ namespace osu.Game.Online.Leaderboards
|
||||
|
||||
placeholderState = value;
|
||||
|
||||
Debug.Assert(placeholderState != PlaceholderState.Successful || scores?.Any() == true);
|
||||
|
||||
switch (placeholderState)
|
||||
{
|
||||
case PlaceholderState.NetworkFailure:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new ClickablePlaceholder(@"Couldn't fetch scores!", FontAwesome.Solid.Sync)
|
||||
{
|
||||
Action = RefetchScores
|
||||
@ -255,26 +254,32 @@ namespace osu.Game.Online.Leaderboards
|
||||
break;
|
||||
|
||||
case PlaceholderState.NoneSelected:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new MessagePlaceholder(@"Please select a beatmap!"));
|
||||
break;
|
||||
|
||||
case PlaceholderState.Unavailable:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new MessagePlaceholder(@"Leaderboards are not available for this beatmap!"));
|
||||
break;
|
||||
|
||||
case PlaceholderState.NoScores:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new MessagePlaceholder(@"No records yet!"));
|
||||
break;
|
||||
|
||||
case PlaceholderState.NotLoggedIn:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new LoginPlaceholder(@"Please sign in to view online leaderboards!"));
|
||||
break;
|
||||
|
||||
case PlaceholderState.NotSupporter:
|
||||
Debug.Assert(scores?.Any() != true);
|
||||
replacePlaceholder(new MessagePlaceholder(@"Please invest in an osu!supporter tag to view this leaderboard!"));
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.Assert(scores?.Any() == true);
|
||||
replacePlaceholder(null);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user