1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

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

View File

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

View File

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