mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Simplify score font lookup
This commit is contained in:
parent
9f51327e4b
commit
37e9f331ad
@ -6,8 +6,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
|
||||
@ -248,10 +246,6 @@ namespace osu.Game.Screens.Play.HUD
|
||||
return difference * rolling_duration;
|
||||
}
|
||||
|
||||
private Drawable createSpriteText() => skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText)) ?? new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.Numeric.With(size: 40),
|
||||
UseFullGlyphHeight = false,
|
||||
};
|
||||
private Drawable createSpriteText() => new LegacySpriteText(skin);
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,5 @@ namespace osu.Game.Skinning
|
||||
public enum HUDSkinComponents
|
||||
{
|
||||
ComboCounter,
|
||||
ScoreText
|
||||
}
|
||||
}
|
||||
|
@ -324,24 +324,23 @@ namespace osu.Game.Skinning
|
||||
return null;
|
||||
}
|
||||
|
||||
private const string score_font = "score";
|
||||
|
||||
private bool hasScoreFont => this.HasFont(score_font);
|
||||
|
||||
public override Drawable GetDrawableComponent(ISkinComponent component)
|
||||
{
|
||||
switch (component)
|
||||
{
|
||||
case HUDSkinComponent hudComponent:
|
||||
{
|
||||
if (!hasScoreFont)
|
||||
return null;
|
||||
|
||||
switch (hudComponent.Component)
|
||||
{
|
||||
case HUDSkinComponents.ComboCounter:
|
||||
return new LegacyComboCounter();
|
||||
|
||||
case HUDSkinComponents.ScoreText:
|
||||
const string font = "score";
|
||||
|
||||
if (!this.HasFont(font))
|
||||
return null;
|
||||
|
||||
return new LegacySpriteText(this, font);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
private readonly LegacyGlyphStore glyphStore;
|
||||
|
||||
public LegacySpriteText(ISkin skin, string font)
|
||||
public LegacySpriteText(ISkin skin, string font = "score")
|
||||
{
|
||||
Shadow = false;
|
||||
UseFullGlyphHeight = false;
|
||||
|
Loading…
Reference in New Issue
Block a user