Add basic support for scoreentry- skinnable text

This commit is contained in:
Dean Herbert
2026-02-17 15:54:31 +09:00
parent 94cec71502
commit 71583bc06f
3 changed files with 11 additions and 6 deletions

View File

@@ -11,5 +11,6 @@ namespace osu.Game.Skinning
Score,
Combo,
HitCircle,
ScoreEntry,
}
}

View File

@@ -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)

View File

@@ -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, string>(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, float>(LegacySetting.ScoreOverlap)?.Value ?? 0f;