1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 12:42:54 +08:00

Merge pull request #22043 from frenzibyte/fix-solo-leaderboard-hyphen

Fix gameplay leaderboard showing "-" on non-tracked scores
This commit is contained in:
Dean Herbert 2023-01-06 18:12:00 +08:00 committed by GitHub
commit 938658649e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -171,13 +171,13 @@ namespace osu.Game.Screens.Play.HUD
for (int i = 0; i < Flow.Count; i++) for (int i = 0; i < Flow.Count; i++)
{ {
Flow.SetLayoutPosition(orderedByScore[i], i); Flow.SetLayoutPosition(orderedByScore[i], i);
orderedByScore[i].ScorePosition = CheckValidScorePosition(i + 1) ? i + 1 : null; orderedByScore[i].ScorePosition = CheckValidScorePosition(orderedByScore[i], i + 1) ? i + 1 : null;
} }
sorting.Validate(); sorting.Validate();
} }
protected virtual bool CheckValidScorePosition(int i) => true; protected virtual bool CheckValidScorePosition(GameplayLeaderboardScore score, int position) => true;
private partial class InputDisabledScrollContainer : OsuScrollContainer private partial class InputDisabledScrollContainer : OsuScrollContainer
{ {

View File

@ -100,16 +100,16 @@ namespace osu.Game.Screens.Play.HUD
local.DisplayOrder.Value = long.MaxValue; local.DisplayOrder.Value = long.MaxValue;
} }
protected override bool CheckValidScorePosition(int i) protected override bool CheckValidScorePosition(GameplayLeaderboardScore score, int position)
{ {
// change displayed position to '-' when there are 50 already submitted scores and tracked score is last // change displayed position to '-' when there are 50 already submitted scores and tracked score is last
if (scoreSource.Value != PlayBeatmapDetailArea.TabType.Local) if (score.Tracked && scoreSource.Value != PlayBeatmapDetailArea.TabType.Local)
{ {
if (i == Flow.Count && Flow.Count > GetScoresRequest.MAX_SCORES_PER_REQUEST) if (position == Flow.Count && Flow.Count > GetScoresRequest.MAX_SCORES_PER_REQUEST)
return false; return false;
} }
return base.CheckValidScorePosition(i); return base.CheckValidScorePosition(score, position);
} }
private void updateVisibility() => private void updateVisibility() =>