1
0
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:
Salman Ahmed 2020-08-19 07:58:23 +03:00
parent 4dbf695bca
commit 422100192c
4 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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

View File

@ -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;
}
}