1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 12:02:54 +08:00

Add protected method for customising statistics panel rows

This commit is contained in:
Bartłomiej Dach 2022-12-24 10:51:09 +01:00
parent 600ada46be
commit 3abdf557ea
No known key found for this signature in database

View File

@ -100,7 +100,7 @@ namespace osu.Game.Screens.Ranking.Statistics
bool hitEventsAvailable = newScore.HitEvents.Count != 0;
Container<Drawable> container;
var statisticRows = newScore.Ruleset.CreateInstance().CreateStatisticsForScore(newScore, task.GetResultSafely());
var statisticRows = CreateStatisticRows(newScore, task.GetResultSafely());
if (!hitEventsAvailable && statisticRows.SelectMany(r => r.Columns).All(c => c.RequiresHitEvents))
{
@ -218,6 +218,14 @@ namespace osu.Game.Screens.Ranking.Statistics
}), localCancellationSource.Token);
}
/// <summary>
/// Creates the <see cref="StatisticRow"/>s to be displayed in this panel for a given <paramref name="newScore"/>.
/// </summary>
/// <param name="newScore">The score to create the rows for.</param>
/// <param name="playableBeatmap">The beatmap on which the score was set.</param>
protected virtual ICollection<StatisticRow> CreateStatisticRows(ScoreInfo newScore, IBeatmap playableBeatmap)
=> newScore.Ruleset.CreateInstance().CreateStatisticsForScore(newScore, playableBeatmap);
protected override bool OnClick(ClickEvent e)
{
ToggleVisibility();