1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:02:55 +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
{
private NonPlayfieldSprite cursor;
private bool spin;
public LegacyCursor()
{
Size = new Vector2(50);
@ -22,6 +25,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
spin = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true;
InternalChildren = new Drawable[]
{
new NonPlayfieldSprite
@ -30,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
new NonPlayfieldSprite
cursor = new NonPlayfieldSprite
{
Texture = skin.GetTexture("cursor"),
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,
AllowSliderBallTint,
CursorExpand,
CursorRotate
}
}