From d71b51690235187b31fb73a28f70d1cedf583dd8 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 28 Feb 2020 21:58:37 +0100 Subject: [PATCH] Check beatmap ranking status instead of the pp value --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 10 +++++++--- .../BeatmapSet/Scores/TopScoreStatisticsSection.cs | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index c9008adc85..25537537d9 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions; +using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -28,6 +29,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private readonly FillFlowContainer backgroundFlow; private Color4 highAccuracyColour; + private bool isBeatmapRanked; public ScoreTable() { @@ -65,7 +67,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores for (int i = 0; i < value.Count; i++) backgroundFlow.Add(new ScoreTableRowBackground(i, value[i], row_height)); - Columns = createHeaders(value[0]); + isBeatmapRanked = value.First().Beatmap.Status == BeatmapSetOnlineStatus.Ranked; + + Columns = createHeaders(value.First()); Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular(); } } @@ -88,7 +92,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95))); - if (score.PP.HasValue) + if (isBeatmapRanked) columns.Add(new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30))); columns.Add(new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize))); @@ -149,7 +153,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }); } - if (score.PP.HasValue) + if (isBeatmapRanked) { content.Add(new OsuSpriteText { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 12ad014f61..9ecc40eed2 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; @@ -96,7 +97,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores totalScoreColumn.Text = $@"{value.TotalScore:N0}"; accuracyColumn.Text = value.DisplayAccuracy; maxComboColumn.Text = $@"{value.MaxCombo:N0}x"; - ppColumn.Alpha = value.PP.HasValue ? 1 : 0; + ppColumn.Alpha = value.Beatmap.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0; ppColumn.Text = $@"{value.PP:N0}"; statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));