mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Move HasFont to legacy skin extensions class instead
This commit is contained in:
parent
4dbf695bca
commit
422100192c
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
||||
var fontOverlap = GetConfig<LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? -2f;
|
||||
|
||||
// For simplicity, let's use legacy combo font texture existence as a way to identify legacy skins from default.
|
||||
if (HasFont(comboFont))
|
||||
if (this.HasFont(comboFont))
|
||||
return new LegacyComboCounter(Source, comboFont, fontOverlap);
|
||||
|
||||
break;
|
||||
|
@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
var font = GetConfig<OsuSkinConfiguration, string>(OsuSkinConfiguration.HitCirclePrefix)?.Value ?? "default";
|
||||
var overlap = GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.HitCircleOverlap)?.Value ?? -2;
|
||||
|
||||
return !HasFont(font)
|
||||
return !this.HasFont(font)
|
||||
? null
|
||||
: new LegacySpriteText(Source, font)
|
||||
{
|
||||
|
@ -62,6 +62,9 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasFont(this ISkin source, string fontPrefix)
|
||||
=> source.GetTexture($"{fontPrefix}-0") != null;
|
||||
|
||||
public class SkinnableTextureAnimation : TextureAnimation
|
||||
{
|
||||
[Resolved(canBeNull: true)]
|
||||
|
@ -47,7 +47,5 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
public abstract IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup);
|
||||
|
||||
protected bool HasFont(string fontPrefix) => GetTexture($"{fontPrefix}-0") != null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user