1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 07:53:38 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Skinning/LegacyCursor.cs

53 lines
1.5 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Skinning;
using osu.Game.Rulesets.Osu.UI.Cursor;
using osuTK;
namespace osu.Game.Rulesets.Osu.Skinning
{
public class LegacyCursor : OsuCursorSprite
{
private bool spin;
public LegacyCursor()
{
Size = new Vector2(50);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
}
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
{
spin = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true;
2019-12-10 20:40:10 +08:00
InternalChildren = new[]
{
2019-12-14 18:33:56 +08:00
ExpandTarget = new NonPlayfieldSprite
{
2019-12-14 18:33:56 +08:00
Texture = skin.GetTexture("cursor"),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
2019-12-14 18:33:56 +08:00
new NonPlayfieldSprite
{
2019-12-14 18:33:56 +08:00
Texture = skin.GetTexture("cursormiddle"),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2019-12-14 18:33:56 +08:00
},
};
2019-12-08 20:47:28 +08:00
}
protected override void LoadComplete()
{
2019-12-09 12:11:04 +08:00
if (spin)
ExpandTarget.Spin(10000, RotationDirection.Clockwise);
}
}
}