mirror of
https://github.com/ppy/osu
synced 2025-01-10 16:19:47 +00:00
Merge pull request #7971 from TheWildTree/show-loved-pp
Hide pp display on leaderboards if map is qualified or loved
This commit is contained in:
commit
1648a0d2d3
@ -52,22 +52,28 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
highAccuracyColour = colours.GreenLight;
|
highAccuracyColour = colours.GreenLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyList<ScoreInfo> Scores
|
private bool showPerformancePoints;
|
||||||
|
|
||||||
|
public void DisplayScores(IReadOnlyList<ScoreInfo> scores, bool showPerformanceColumn)
|
||||||
{
|
{
|
||||||
set
|
ClearScores();
|
||||||
{
|
|
||||||
Content = null;
|
|
||||||
backgroundFlow.Clear();
|
|
||||||
|
|
||||||
if (value?.Any() != true)
|
if (!scores.Any())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < value.Count; i++)
|
showPerformancePoints = showPerformanceColumn;
|
||||||
backgroundFlow.Add(new ScoreTableRowBackground(i, value[i], row_height));
|
|
||||||
|
|
||||||
Columns = createHeaders(value[0]);
|
for (int i = 0; i < scores.Count; i++)
|
||||||
Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
|
backgroundFlow.Add(new ScoreTableRowBackground(i, scores[i], row_height));
|
||||||
}
|
|
||||||
|
Columns = createHeaders(scores.FirstOrDefault());
|
||||||
|
Content = scores.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearScores()
|
||||||
|
{
|
||||||
|
Content = null;
|
||||||
|
backgroundFlow.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TableColumn[] createHeaders(ScoreInfo score)
|
private TableColumn[] createHeaders(ScoreInfo score)
|
||||||
@ -88,11 +94,10 @@ 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)));
|
columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95)));
|
||||||
|
|
||||||
columns.AddRange(new[]
|
if (showPerformancePoints)
|
||||||
{
|
columns.Add(new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)));
|
||||||
new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)),
|
|
||||||
new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)),
|
columns.Add(new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)));
|
||||||
});
|
|
||||||
|
|
||||||
return columns.ToArray();
|
return columns.ToArray();
|
||||||
}
|
}
|
||||||
@ -150,24 +155,25 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
content.AddRange(new Drawable[]
|
if (showPerformancePoints)
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
content.Add(new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = $@"{score.PP:N0}",
|
Text = $@"{score.PP:N0}",
|
||||||
Font = OsuFont.GetFont(size: text_size)
|
Font = OsuFont.GetFont(size: text_size)
|
||||||
},
|
});
|
||||||
new FillFlowContainer
|
}
|
||||||
|
|
||||||
|
content.Add(new FillFlowContainer
|
||||||
|
{
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(1),
|
||||||
|
ChildrenEnumerable = score.Mods.Select(m => new ModIcon(m)
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Spacing = new Vector2(1),
|
Scale = new Vector2(0.3f)
|
||||||
ChildrenEnumerable = score.Mods.Select(m => new ModIcon(m)
|
})
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Scale = new Vector2(0.3f)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return content.ToArray();
|
return content.ToArray();
|
||||||
|
@ -52,17 +52,17 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
if (value?.Scores.Any() != true)
|
if (value?.Scores.Any() != true)
|
||||||
{
|
{
|
||||||
scoreTable.Scores = null;
|
scoreTable.ClearScores();
|
||||||
scoreTable.Hide();
|
scoreTable.Hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
|
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
|
||||||
|
var topScore = scoreInfos.First();
|
||||||
|
|
||||||
scoreTable.Scores = scoreInfos;
|
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked);
|
||||||
scoreTable.Show();
|
scoreTable.Show();
|
||||||
|
|
||||||
var topScore = scoreInfos.First();
|
|
||||||
var userScore = value.UserScore;
|
var userScore = value.UserScore;
|
||||||
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
|
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
@ -96,6 +97,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
totalScoreColumn.Text = $@"{value.TotalScore:N0}";
|
totalScoreColumn.Text = $@"{value.TotalScore:N0}";
|
||||||
accuracyColumn.Text = value.DisplayAccuracy;
|
accuracyColumn.Text = value.DisplayAccuracy;
|
||||||
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
|
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
|
||||||
|
ppColumn.Alpha = value.Beatmap?.Status == BeatmapSetOnlineStatus.Ranked ? 1 : 0;
|
||||||
ppColumn.Text = $@"{value.PP:N0}";
|
ppColumn.Text = $@"{value.PP:N0}";
|
||||||
|
|
||||||
statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
|
statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
|
||||||
|
Loading…
Reference in New Issue
Block a user