mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Merge branch 'master' into local-score-saving
This commit is contained in:
commit
b985d19078
@ -57,6 +57,8 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
public List<ScoreInfo> GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
|
public List<ScoreInfo> GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList();
|
||||||
|
|
||||||
|
public IEnumerable<ScoreInfo> QueryScores(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query);
|
||||||
|
|
||||||
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query);
|
public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,9 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
private APIAccess api;
|
private APIAccess api;
|
||||||
private BeatmapInfo beatmap;
|
private BeatmapInfo beatmap;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private ScoreManager scoreManager { get; set; }
|
||||||
|
|
||||||
private ScheduledDelegate pendingUpdateScores;
|
private ScheduledDelegate pendingUpdateScores;
|
||||||
|
|
||||||
public BeatmapInfo Beatmap
|
public BeatmapInfo Beatmap
|
||||||
@ -216,6 +219,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
api.OnStateChange -= handleApiStateChange;
|
api.OnStateChange -= handleApiStateChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RefreshScores() => updateScores();
|
||||||
|
|
||||||
private GetScoresRequest getScoresRequest;
|
private GetScoresRequest getScoresRequest;
|
||||||
|
|
||||||
private void handleApiStateChange(APIState oldState, APIState newState)
|
private void handleApiStateChange(APIState oldState, APIState newState)
|
||||||
@ -242,8 +247,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
if (Scope == LeaderboardScope.Local)
|
if (Scope == LeaderboardScope.Local)
|
||||||
{
|
{
|
||||||
// TODO: get local scores from wherever here.
|
Scores = scoreManager.QueryScores(s => s.Beatmap.ID == Beatmap.ID).ToArray();
|
||||||
PlaceholderState = PlaceholderState.NoScores;
|
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +108,8 @@ namespace osu.Game.Screens.Select
|
|||||||
removeAutoModOnResume = false;
|
removeAutoModOnResume = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BeatmapDetails.Leaderboard.RefreshScores();
|
||||||
|
|
||||||
Beatmap.Value.Track.Looping = true;
|
Beatmap.Value.Track.Looping = true;
|
||||||
|
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
|
Loading…
Reference in New Issue
Block a user