mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Fix unranked beatmap leaderboards showing "no records" placehol… (#5259)
Fix unranked beatmap leaderboards showing "no records" placeholder Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
commit
ffc3c9f8f6
@ -4,12 +4,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Online.Leaderboards;
|
using osu.Game.Online.Leaderboards;
|
||||||
using osu.Game.Rulesets;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -27,8 +24,6 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
typeof(RetrievalFailurePlaceholder),
|
typeof(RetrievalFailurePlaceholder),
|
||||||
};
|
};
|
||||||
|
|
||||||
private RulesetStore rulesets;
|
|
||||||
|
|
||||||
private readonly FailableLeaderboard leaderboard;
|
private readonly FailableLeaderboard leaderboard;
|
||||||
|
|
||||||
public TestSceneLeaderboard()
|
public TestSceneLeaderboard()
|
||||||
@ -47,13 +42,8 @@ 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(@"Real beatmap", realBeatmap);
|
foreach (BeatmapSetOnlineStatus status in Enum.GetValues(typeof(BeatmapSetOnlineStatus)))
|
||||||
}
|
AddStep($"{status} beatmap", () => showBeatmapWithStatus(status));
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(RulesetStore rulesets)
|
|
||||||
{
|
|
||||||
this.rulesets = rulesets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void newScores()
|
private void newScores()
|
||||||
@ -245,34 +235,12 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
leaderboard.Scores = scores;
|
leaderboard.Scores = scores;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void realBeatmap()
|
private void showBeatmapWithStatus(BeatmapSetOnlineStatus status)
|
||||||
{
|
{
|
||||||
leaderboard.Beatmap = new BeatmapInfo
|
leaderboard.Beatmap = new BeatmapInfo
|
||||||
{
|
{
|
||||||
StarDifficulty = 1.36,
|
|
||||||
Version = @"BASIC",
|
|
||||||
OnlineBeatmapID = 1113057,
|
OnlineBeatmapID = 1113057,
|
||||||
Ruleset = rulesets.GetRuleset(0),
|
Status = status,
|
||||||
BaseDifficulty = new BeatmapDifficulty
|
|
||||||
{
|
|
||||||
CircleSize = 4,
|
|
||||||
DrainRate = 6.5f,
|
|
||||||
OverallDifficulty = 6.5f,
|
|
||||||
ApproachRate = 5,
|
|
||||||
},
|
|
||||||
OnlineInfo = new BeatmapOnlineInfo
|
|
||||||
{
|
|
||||||
Length = 115000,
|
|
||||||
CircleCount = 265,
|
|
||||||
SliderCount = 71,
|
|
||||||
PlayCount = 47906,
|
|
||||||
PassCount = 19899,
|
|
||||||
},
|
|
||||||
Metrics = new BeatmapMetrics
|
|
||||||
{
|
|
||||||
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
|
|
||||||
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Beatmap?.OnlineBeatmapID == null)
|
if (Beatmap?.OnlineBeatmapID == null || Beatmap?.Status <= BeatmapSetOnlineStatus.Pending)
|
||||||
{
|
{
|
||||||
PlaceholderState = PlaceholderState.Unavailable;
|
PlaceholderState = PlaceholderState.Unavailable;
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user