1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Merge pull request #2257 from peppy/cursor-skinning

Add the ability to skin the gameplay cursor
This commit is contained in:
Dan Balasescu 2018-03-23 19:32:20 +09:00 committed by GitHub
commit 23a3958e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Skinning;
using OpenTK;
using OpenTK.Graphics;
@ -82,7 +83,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public class OsuCursor : Container
{
private Container cursorContainer;
private Drawable cursorContainer;
private Bindable<double> cursorScale;
private Bindable<bool> autoCursorScale;
@ -97,12 +98,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, OsuGameBase game)
{
Children = new Drawable[]
Child = cursorContainer = new SkinnableDrawable("cursor", _ => new CircularContainer
{
cursorContainer = new CircularContainer
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderThickness = Size.X / 6,
@ -156,7 +153,11 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
},
},
}
},
}, restrictSize: false)
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
};
beatmap = game.Beatmap.GetBoundCopy();