1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 13:33:03 +08:00

Better counter formatization

Now CS and HP have 1 decimal point precision, while AR and OD is kept with 2 because of future support of rate-changed AR/OD
This commit is contained in:
Givikap120 2023-09-08 22:15:30 +03:00
parent ed213dad6c
commit 507f9642cc
2 changed files with 10 additions and 7 deletions

View File

@ -159,10 +159,10 @@ namespace osu.Game.Overlays.Mods
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Children = new[] Children = new[]
{ {
circleSizeDisplay = new VerticalAttributeDisplay("CS"), circleSizeDisplay = new VerticalAttributeDisplay("CS", "0.#"),
drainRateDisplay = new VerticalAttributeDisplay("HP"), drainRateDisplay = new VerticalAttributeDisplay("HP", "0.#"),
approachRateDisplay = new VerticalAttributeDisplay("AR"), approachRateDisplay = new VerticalAttributeDisplay("AR", "0.##"),
overallDifficultyDisplay = new VerticalAttributeDisplay("OD"), overallDifficultyDisplay = new VerticalAttributeDisplay("OD", "0.##"),
} }
} }
} }

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Mods
/// </summary> /// </summary>
public LocalisableString Label { get; protected set; } public LocalisableString Label { get; protected set; }
public VerticalAttributeDisplay(LocalisableString label) public VerticalAttributeDisplay(LocalisableString label, string format = "0.#")
{ {
Label = label; Label = label;
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
@ -54,7 +54,8 @@ namespace osu.Game.Overlays.Mods
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Current = { BindTarget = Current } Current = { BindTarget = Current },
Format = format
} }
} }
}; };
@ -64,7 +65,9 @@ namespace osu.Game.Overlays.Mods
{ {
protected override double RollingDuration => 500; protected override double RollingDuration => 500;
protected override LocalisableString FormatCount(double count) => count.ToLocalisableString("0.##"); public string Format = "0.#";
protected override LocalisableString FormatCount(double count) => count.ToLocalisableString(Format);
protected override OsuSpriteText CreateSpriteText() => new OsuSpriteText protected override OsuSpriteText CreateSpriteText() => new OsuSpriteText
{ {