From 67010fcd03b1546ef0bbf24fdf864db69ad5bb58 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 24 Jan 2024 23:45:07 +0300 Subject: [PATCH 1/2] Reduce allocation overhead in ScoreCounter --- osu.Game/Graphics/UserInterface/ScoreCounter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index 255b2149f0..62cdefda43 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -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)); From 781196858209dcc6804182b9d8dfac2896e6fd1d Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 25 Jan 2024 03:28:02 +0300 Subject: [PATCH 2/2] Fix ArgonScoreCounter is still using localisation --- osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs b/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs index 348327d710..44b9fb3123 100644 --- a/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs @@ -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()) {