mirror of
https://github.com/ppy/osu
synced 2024-12-24 15:53:37 +00:00
Allow skin to disable spin
This commit is contained in:
parent
4cd0dd7856
commit
b2b252a1cc
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -11,5 +11,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
SliderPathRadius,
|
||||
AllowSliderBallTint,
|
||||
CursorExpand,
|
||||
CursorRotate
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user