1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 21:53:21 +08:00

Enforce correct column order in ScoreTable

This commit is contained in:
TheWildTree 2020-02-04 21:28:31 +01:00
parent d23e4a1fa1
commit 9795897045

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
@ -65,6 +65,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
for (int i = 0; i < value.Count; i++)
backgroundFlow.Add(new ScoreTableRowBackground(i, value[i]));
// Ensure correct column order
foreach (ScoreInfo score in value)
score.Statistics = score.Statistics.OrderByDescending(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value);
Columns = createHeaders(value[0]);
Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
}