1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 14:22:55 +08:00

Only keep track of the names of hit results to display in a ScoreTable

This commit is contained in:
Jonas Brandstötter 2024-10-14 16:55:07 +02:00
parent 285756802c
commit a007a81fe8
No known key found for this signature in database
GPG Key ID: DF758C8A6271E098

View File

@ -57,11 +57,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
}
/// <summary>
/// The statistics that appear in the table, grouped by their display name. If multiple HitResults have the same
/// The names of the statistics that appear in the table. If multiple HitResults have the same
/// DisplayName (for example, "slider end" is the name for both <see cref="HitResult.SliderTailHit"/> and <see cref="HitResult.SmallTickHit"/>
/// in osu!) the name will only be listed once.
/// </summary>
private readonly List<(LocalisableString displayName, IEnumerable<HitResult> results)> statisticResults = new List<(LocalisableString displayName, IEnumerable<HitResult> results)>();
private readonly List<LocalisableString> statisticResultNames = new List<LocalisableString>();
private bool showPerformancePoints;
@ -73,7 +73,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return;
showPerformancePoints = showPerformanceColumn;
statisticResults.Clear();
statisticResultNames.Clear();
for (int i = 0; i < scores.Count; i++)
backgroundFlow.Add(new ScoreTableRowBackground(i, scores[i], row_height));
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
continue;
columns.Add(new TableColumn(resultGroup.Key, Anchor.CentreLeft, new Dimension(minSize: 35, maxSize: 60)));
statisticResults.Add((resultGroup.Key, resultGroup.Select(r => r.result)));
statisticResultNames.Add(resultGroup.Key);
}
if (showPerformancePoints)
@ -168,7 +168,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
var availableStatistics = score.GetStatisticsForDisplay().ToLookup(tuple => tuple.DisplayName);
foreach (var (columnName, resultTypes) in statisticResults)
foreach (var columnName in statisticResultNames)
{
int count = 0;
int? maxCount = null;
@ -176,6 +176,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
if (availableStatistics.Contains(columnName))
{
maxCount = 0;
foreach (var s in availableStatistics[columnName])
{
count += s.Count;