Add HasPerformancePoints extension method

This commit is contained in:
Joseph Madamba 2021-04-29 14:11:35 -07:00
parent 243605728d
commit cfbf95b433
3 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,12 @@
namespace osu.Game.Beatmaps
{
public static class BeatmapSetOnlineStatusExtensions
{
public static bool HasPerformancePoints(this BeatmapSetOnlineStatus status)
=> status == BeatmapSetOnlineStatus.Ranked || status == BeatmapSetOnlineStatus.Approved;
}
public enum BeatmapSetOnlineStatus
{
None = -3,

View File

@ -59,10 +59,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
var topScore = scoreInfos.First();
var status = topScore.Beatmap?.Status;
var showPerformanceColumn = status == BeatmapSetOnlineStatus.Ranked || status == BeatmapSetOnlineStatus.Approved;
scoreTable.DisplayScores(scoreInfos, showPerformanceColumn);
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.HasPerformancePoints() ?? false);
scoreTable.Show();
var userScore = value.UserScore;

View File

@ -111,7 +111,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
accuracyColumn.Text = value.DisplayAccuracy;
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
ppColumn.Alpha = value.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0;
ppColumn.Alpha = value.Beatmap?.Status.HasPerformancePoints() ?? false ? 1 : 0;
ppColumn.Text = $@"{value.PP:N0}";
statisticsColumns.ChildrenEnumerable = value.GetStatisticsForDisplay().Select(createStatisticsColumn);