Merge pull request #26695 from EVAST9919/rolling-counter-alloc

Reduce localisation overhead in `ScoreCounter`
This commit is contained in:
Dean Herbert 2024-01-25 14:13:35 +09:00 committed by GitHub
commit 254dcfcebc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -4,7 +4,6 @@
#nullable disable
using osu.Framework.Bindables;
using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.Sprites;
@ -39,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
protected override double GetProportionalDuration(long currentValue, long newValue) =>
currentValue > newValue ? currentValue - newValue : newValue - currentValue;
protected override LocalisableString FormatCount(long count) => count.ToLocalisableString(formatString);
protected override LocalisableString FormatCount(long count) => count.ToString(formatString);
protected override OsuSpriteText CreateSpriteText()
=> base.CreateSpriteText().With(s => s.Font = s.Font.With(fixedWidth: true));

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play.HUD
public bool UsesFixedAnchor { get; set; }
protected override LocalisableString FormatCount(long count) => count.ToLocalisableString();
protected override LocalisableString FormatCount(long count) => count.ToString();
protected override IHasText CreateText() => scoreText = new ArgonScoreTextComponent(Anchor.TopRight, BeatmapsetsStrings.ShowScoreboardHeadersScore.ToUpper())
{