From 71583bc06f8d3388deebf886cd89e09f24fb17c2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Feb 2026 15:54:31 +0900 Subject: [PATCH] Add basic support for `scoreentry-` skinnable text --- osu.Game/Skinning/LegacyFont.cs | 1 + osu.Game/Skinning/LegacyKeyCounter.cs | 7 ++----- osu.Game/Skinning/LegacySkinExtensions.cs | 9 ++++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game/Skinning/LegacyFont.cs b/osu.Game/Skinning/LegacyFont.cs index d1971cb84c..bd4971faa4 100644 --- a/osu.Game/Skinning/LegacyFont.cs +++ b/osu.Game/Skinning/LegacyFont.cs @@ -11,5 +11,6 @@ namespace osu.Game.Skinning Score, Combo, HitCircle, + ScoreEntry, } } diff --git a/osu.Game/Skinning/LegacyKeyCounter.cs b/osu.Game/Skinning/LegacyKeyCounter.cs index 609e21b9ff..74c7caf0a0 100644 --- a/osu.Game/Skinning/LegacyKeyCounter.cs +++ b/osu.Game/Skinning/LegacyKeyCounter.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Graphics; using osu.Game.Graphics.Containers; -using osu.Game.Graphics.Sprites; using osu.Game.Screens.Play.HUD; namespace osu.Game.Skinning @@ -32,7 +31,7 @@ namespace osu.Game.Skinning } private readonly Container keyContainer; - private readonly OsuSpriteText overlayKeyText; + private readonly LegacySpriteText overlayKeyText; private readonly Sprite keySprite; public LegacyKeyCounter(InputTrigger trigger) @@ -57,13 +56,12 @@ namespace osu.Game.Skinning AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Child = overlayKeyText = new OsuSpriteText + Child = overlayKeyText = new LegacySpriteText(LegacyFont.ScoreEntry) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = trigger.Name, Colour = textColour, - Font = OsuFont.GetFont(weight: FontWeight.SemiBold), }, }, } @@ -88,7 +86,6 @@ namespace osu.Game.Skinning keyContainer.ScaleTo(0.75f, transition_duration, Easing.Out); keySprite.Colour = ActiveColour; overlayKeyText.Text = CountPresses.Value.ToString(); - overlayKeyText.Font = overlayKeyText.Font.With(weight: FontWeight.SemiBold); } protected override void Deactivate(bool forwardPlayback = true) diff --git a/osu.Game/Skinning/LegacySkinExtensions.cs b/osu.Game/Skinning/LegacySkinExtensions.cs index a8ec67d98b..e4da89fc91 100644 --- a/osu.Game/Skinning/LegacySkinExtensions.cs +++ b/osu.Game/Skinning/LegacySkinExtensions.cs @@ -55,7 +55,8 @@ namespace osu.Game.Skinning } } - public static Texture[] GetTextures(this ISkin? source, string componentName, WrapMode wrapModeS, WrapMode wrapModeT, bool animatable, string animationSeparator, Vector2? maxSize, out ISkin? retrievalSource) + public static Texture[] GetTextures(this ISkin? source, string componentName, WrapMode wrapModeS, WrapMode wrapModeT, bool animatable, string animationSeparator, Vector2? maxSize, + out ISkin? retrievalSource) { retrievalSource = null; @@ -140,6 +141,9 @@ namespace osu.Game.Skinning { switch (font) { + case LegacyFont.ScoreEntry: + return "scoreentry"; + case LegacyFont.Score: return source.GetConfig(LegacySetting.ScorePrefix)?.Value ?? "score"; @@ -163,6 +167,9 @@ namespace osu.Game.Skinning { switch (font) { + case LegacyFont.ScoreEntry: + return 0; + case LegacyFont.Score: return source.GetConfig(LegacySetting.ScoreOverlap)?.Value ?? 0f;