Add support for legacy skin `CursorCentre` setting

This commit is contained in:
Salman Ahmed 2021-04-14 06:33:53 +03:00
parent d076be82a5
commit bf5ed12b75
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@ public LegacyCursor()
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(ISkinSource skin) private void load(ISkinSource skin)
{ {
bool centre = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorCentre)?.Value ?? false;
spin = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true; spin = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true;
InternalChildren = new[] InternalChildren = new[]
@ -32,13 +33,13 @@ private void load(ISkinSource skin)
{ {
Texture = skin.GetTexture("cursor"), Texture = skin.GetTexture("cursor"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = centre ? Anchor.Centre : Anchor.TopLeft,
}, },
new NonPlayfieldSprite new NonPlayfieldSprite
{ {
Texture = skin.GetTexture("cursormiddle"), Texture = skin.GetTexture("cursormiddle"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = centre ? Anchor.Centre : Anchor.TopLeft,
}, },
}; };
} }

View File

@ -8,6 +8,7 @@ public enum OsuSkinConfiguration
SliderBorderSize, SliderBorderSize,
SliderPathRadius, SliderPathRadius,
AllowSliderBallTint, AllowSliderBallTint,
CursorCentre,
CursorExpand, CursorExpand,
CursorRotate, CursorRotate,
HitCircleOverlayAboveNumber, HitCircleOverlayAboveNumber,