Allow skin to disable spin

This commit is contained in:
mcendu 2019-12-09 08:36:07 +08:00
parent 4cd0dd7856
commit b2b252a1cc
3 changed files with 10 additions and 3 deletions

View File

@ -11,15 +11,18 @@ namespace osu.Game.Rulesets.Osu.Skinning
{
public class LegacyCursor : CompositeDrawable
{
public LegacyCursor()
public LegacyCursor(bool spin = true)
{
Size = new Vector2(50);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
rotate = spin;
}
private NonPlayfieldSprite cursor;
private bool rotate;
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
@ -43,6 +46,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
protected override void LoadComplete()
{
if (rotate)
cursor.Spin(10000, RotationDirection.Clockwise);
}
}

View File

@ -81,7 +81,9 @@ namespace osu.Game.Rulesets.Osu.Skinning
case OsuSkinComponents.Cursor:
if (source.GetTexture("cursor") != null)
return new LegacyCursor();
{
return new LegacyCursor(GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true);
}
return null;

View File

@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
SliderPathRadius,
AllowSliderBallTint,
CursorExpand,
CursorRotate
}
}