From cfbf95b4331c777a5dbd109fb57b3e5f76e2fc93 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Thu, 29 Apr 2021 14:11:35 -0700 Subject: [PATCH] Add HasPerformancePoints extension method --- ...tOnlineStatus.cs => BeatmapSetOnlineStatusExtensions.cs} | 6 ++++++ osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 4 +--- .../Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) rename osu.Game/Beatmaps/{BeatmapSetOnlineStatus.cs => BeatmapSetOnlineStatusExtensions.cs} (61%) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs b/osu.Game/Beatmaps/BeatmapSetOnlineStatusExtensions.cs similarity index 61% rename from osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs rename to osu.Game/Beatmaps/BeatmapSetOnlineStatusExtensions.cs index 5864975a2e..1de641f4f1 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineStatusExtensions.cs @@ -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, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 3e95d125de..8786cf0e63 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -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; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 5cb834b510..57df54d851 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -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);