mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08: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,7 +46,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
cursor.Spin(10000, RotationDirection.Clockwise);
|
||||
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