mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add leaderboard display for local scores
This commit is contained in:
@ -179,6 +179,9 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
private APIAccess api;
|
||||
private BeatmapInfo beatmap;
|
||||
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
private ScheduledDelegate pendingUpdateScores;
|
||||
|
||||
public BeatmapInfo Beatmap
|
||||
@ -216,6 +219,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
api.OnStateChange -= handleApiStateChange;
|
||||
}
|
||||
|
||||
public void RefreshScores() => updateScores();
|
||||
|
||||
private GetScoresRequest getScoresRequest;
|
||||
|
||||
private void handleApiStateChange(APIState oldState, APIState newState)
|
||||
@ -242,8 +247,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
if (Scope == LeaderboardScope.Local)
|
||||
{
|
||||
// TODO: get local scores from wherever here.
|
||||
PlaceholderState = PlaceholderState.NoScores;
|
||||
Scores = scoreManager.QueryScores(s => s.BeatmapInfo.ID == Beatmap.ID).ToArray();
|
||||
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,8 @@ namespace osu.Game.Screens.Select
|
||||
removeAutoModOnResume = false;
|
||||
}
|
||||
|
||||
BeatmapDetails.Leaderboard.RefreshScores();
|
||||
|
||||
Beatmap.Value.Track.Looping = true;
|
||||
|
||||
base.OnResuming(last);
|
||||
|
Reference in New Issue
Block a user