Implement HitCircleFont skin configuration

This commit is contained in:
smoogipoo 2018-09-27 17:27:24 +09:00
parent 0d8276c5f8
commit 8191f03503
3 changed files with 18 additions and 2 deletions

View File

@ -57,8 +57,7 @@ public override Drawable GetDrawableComponent(string componentName)
componentName = "hit300"; componentName = "hit300";
break; break;
case "Play/osu/number-text": case "Play/osu/number-text":
// Todo: Not necessarily default font return hasFont(Configuration.HitCircleFont) ? new LegacySpriteText(Textures, Configuration.HitCircleFont) : null;
return hasFont("default") ? new LegacySpriteText(Textures, "default") : null;
} }
var texture = GetTexture(componentName); var texture = GetTexture(componentName);

View File

@ -19,6 +19,7 @@ protected override void ParseLine(SkinConfiguration skin, Section section, strin
switch (section) switch (section)
{ {
case Section.General: case Section.General:
{
var pair = SplitKeyVal(line); var pair = SplitKeyVal(line);
switch (pair.Key) switch (pair.Key)
@ -32,6 +33,20 @@ protected override void ParseLine(SkinConfiguration skin, Section section, strin
} }
break; break;
}
case Section.Fonts:
{
var pair = SplitKeyVal(line);
switch (pair.Key)
{
case "HitCirclePrefix":
skin.HitCircleFont = pair.Value;
break;
}
break;
}
} }
base.ParseLine(skin, section, line); base.ParseLine(skin, section, line);

View File

@ -14,5 +14,7 @@ public class SkinConfiguration : IHasComboColours, IHasCustomColours
public List<Color4> ComboColours { get; set; } = new List<Color4>(); public List<Color4> ComboColours { get; set; } = new List<Color4>();
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>(); public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public string HitCircleFont { get; set; } = "default";
} }
} }