mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
Add HasPerformancePoints extension method
This commit is contained in:
parent
243605728d
commit
cfbf95b433
@ -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,
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user