1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:47:25 +08:00

Revert accuracy display and column sorting changes

This commit is contained in:
TheWildTree 2020-02-06 20:21:47 +01:00
parent c93d2c7f00
commit c09af0052b
2 changed files with 5 additions and 10 deletions

View File

@ -16,7 +16,6 @@ using osu.Game.Scoring;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Utils;
namespace osu.Game.Overlays.BeatmapSet.Scores namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
@ -66,10 +65,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
for (int i = 0; i < value.Count; i++) for (int i = 0; i < value.Count; i++)
backgroundFlow.Add(new ScoreTableRowBackground(i, value[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]); Columns = createHeaders(value[0]);
Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular(); Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
} }
@ -121,7 +116,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
new OsuSpriteText new OsuSpriteText
{ {
Margin = new MarginPadding { Right = horizontal_inset }, Margin = new MarginPadding { Right = horizontal_inset },
Text = score.Accuracy.FormatAccuracy(alwaysShowDecimals: true), Text = score.DisplayAccuracy,
Font = OsuFont.GetFont(size: text_size), Font = OsuFont.GetFont(size: text_size),
Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White
}, },

View File

@ -7,18 +7,18 @@ namespace osu.Game.Utils
{ {
/// <summary> /// <summary>
/// Turns the provided accuracy into a percentage with 2 decimal places. /// Turns the provided accuracy into a percentage with 2 decimal places.
/// Omits all decimal places when <paramref name="accuracy"/> equals 1d.
/// </summary> /// </summary>
/// <param name="accuracy">The accuracy to be formatted</param> /// <param name="accuracy">The accuracy to be formatted</param>
/// <param name="alwaysShowDecimals">Whether to show decimal places if <paramref name="accuracy"/> equals 1d</param>
/// <returns>formatted accuracy in percentage</returns> /// <returns>formatted accuracy in percentage</returns>
public static string FormatAccuracy(this double accuracy, bool alwaysShowDecimals = false) => accuracy == 1 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00%}"; public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}";
/// <summary> /// <summary>
/// Turns the provided accuracy into a percentage with 2 decimal places. /// Turns the provided accuracy into a percentage with 2 decimal places.
/// Omits all decimal places when <paramref name="accuracy"/> equals 100m.
/// </summary> /// </summary>
/// <param name="accuracy">The accuracy to be formatted</param> /// <param name="accuracy">The accuracy to be formatted</param>
/// <param name="alwaysShowDecimals">Whether to show decimal places if <paramref name="accuracy"/> equals 100m</param>
/// <returns>formatted accuracy in percentage</returns> /// <returns>formatted accuracy in percentage</returns>
public static string FormatAccuracy(this decimal accuracy, bool alwaysShowDecimals = false) => accuracy == 100 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00}%"; public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%";
} }
} }