Add support for the HitCircleOverlap property in legacy skins

This commit is contained in:
Jamie Taylor 2019-02-15 21:03:06 +09:00
parent e9709e82b8
commit 38cf5a1ea4
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
3 changed files with 12 additions and 1 deletions

View File

@ -58,7 +58,14 @@ public override Drawable GetDrawableComponent(string componentName)
componentName = "hit300";
break;
case "Play/osu/number-text":
return !hasFont(Configuration.HitCircleFont) ? null : new LegacySpriteText(Textures, Configuration.HitCircleFont) { Scale = new Vector2(0.96f) };
return !hasFont(Configuration.HitCircleFont)
? null
: new LegacySpriteText(Textures, Configuration.HitCircleFont)
{
Scale = new Vector2(0.96f),
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
Spacing = new Vector2(-Configuration.HitCircleOverlap * 0.89f, 0)
};
}
var texture = GetTexture(componentName);

View File

@ -46,6 +46,9 @@ protected override void ParseLine(SkinConfiguration skin, Section section, strin
case "HitCirclePrefix":
skin.HitCircleFont = pair.Value;
break;
case "HitCircleOverlap":
skin.HitCircleOverlap = int.Parse(pair.Value);
break;
}
break;

View File

@ -22,6 +22,7 @@ public class SkinConfiguration : IHasComboColours, IHasCustomColours
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public string HitCircleFont { get; set; } = "default";
public int HitCircleOverlap { get; set; }
public bool? CursorExpand { get; set; } = true;
}