Skip to content

Commit

Permalink
Merge pull request ppy#12617 from Joehuu/fix-pp-column-approved-maps
Browse files Browse the repository at this point in the history
Fix approved maps not displaying pp column on score table
  • Loading branch information
peppy authored May 2, 2021
2 parents 05e18e3 + 137be5d commit 2e24b69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ public enum BeatmapSetOnlineStatus
Qualified = 3,
Loved = 4,
}

public static class BeatmapSetOnlineStatusExtensions
{
public static bool GrantsPerformancePoints(this BeatmapSetOnlineStatus status)
=> status == BeatmapSetOnlineStatus.Ranked || status == BeatmapSetOnlineStatus.Approved;
}
}
2 changes: 1 addition & 1 deletion osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected APILegacyScores Scores
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
var topScore = scoreInfos.First();

scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked);
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
scoreTable.Show();

var userScore = value.UserScore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public ScoreInfo Score

accuracyColumn.Text = value.DisplayAccuracy;
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
ppColumn.Alpha = value.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0;

ppColumn.Alpha = value.Beatmap?.Status.GrantsPerformancePoints() == true ? 1 : 0;
ppColumn.Text = $@"{value.PP:N0}";

statisticsColumns.ChildrenEnumerable = value.GetStatisticsForDisplay().Select(createStatisticsColumn);
Expand Down

0 comments on commit 2e24b69

Please sign in to comment.