1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 16:06:06 +08:00

Merge pull request #7095 from mcendu/legacy-cursor

Add skin-controlled cursor rotation
This commit is contained in:
Dan Balasescu 2019-12-09 15:31:33 +09:00 committed by GitHub
commit 6fa2910674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -11,6 +11,9 @@ namespace osu.Game.Rulesets.Osu.Skinning
{ {
public class LegacyCursor : CompositeDrawable public class LegacyCursor : CompositeDrawable
{ {
private NonPlayfieldSprite cursor;
private bool spin;
public LegacyCursor() public LegacyCursor()
{ {
Size = new Vector2(50); Size = new Vector2(50);
@ -22,6 +25,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(ISkinSource skin) private void load(ISkinSource skin)
{ {
spin = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new NonPlayfieldSprite new NonPlayfieldSprite
@ -30,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}, },
new NonPlayfieldSprite cursor = new NonPlayfieldSprite
{ {
Texture = skin.GetTexture("cursor"), Texture = skin.GetTexture("cursor"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -38,5 +43,11 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
}; };
} }
protected override void LoadComplete()
{
if (spin)
cursor.Spin(10000, RotationDirection.Clockwise);
}
} }
} }

View File

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