mirror of
https://github.com/osukey/osukey.git
synced 2025-06-30 07:38:04 +09:00
Move to MenuCursor
This commit is contained in:
parent
bfe1febef2
commit
846838c621
@ -20,13 +20,16 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
protected override Drawable CreateCursor() => new Cursor();
|
protected override Drawable CreateCursor() => new Cursor();
|
||||||
|
|
||||||
|
private Bindable<bool> cursorRotate;
|
||||||
|
private bool dragRotating;
|
||||||
|
|
||||||
private bool dragging;
|
private bool dragging;
|
||||||
|
|
||||||
private bool startRotation;
|
private bool startRotation;
|
||||||
|
|
||||||
protected override bool OnMouseMove(InputState state)
|
protected override bool OnMouseMove(InputState state)
|
||||||
{
|
{
|
||||||
if (((Cursor)ActiveCursor).DragRotating) {
|
if (dragRotating) {
|
||||||
if (dragging) {
|
if (dragging) {
|
||||||
Debug.Assert (state.Mouse.PositionMouseDown != null);
|
Debug.Assert (state.Mouse.PositionMouseDown != null);
|
||||||
|
|
||||||
@ -104,18 +107,23 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
ActiveCursor.ScaleTo(0, 500, Easing.In);
|
ActiveCursor.ScaleTo(0, 500, Easing.In);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuConfigManager config, TextureStore textures, OsuColour colour)
|
||||||
|
{
|
||||||
|
cursorRotate = config.GetBindable<bool> (OsuSetting.CursorRotation);
|
||||||
|
cursorRotate.ValueChanged += newValue => dragRotating = newValue;
|
||||||
|
cursorRotate.TriggerChange();
|
||||||
|
}
|
||||||
|
|
||||||
public class Cursor : Container
|
public class Cursor : Container
|
||||||
{
|
{
|
||||||
private Container cursorContainer;
|
private Container cursorContainer;
|
||||||
private Bindable<double> cursorScale;
|
private Bindable<double> cursorScale;
|
||||||
private Bindable<bool> cursorRotate;
|
|
||||||
|
|
||||||
private const float base_scale = 0.15f;
|
private const float base_scale = 0.15f;
|
||||||
|
|
||||||
public Sprite AdditiveLayer;
|
public Sprite AdditiveLayer;
|
||||||
|
|
||||||
public bool DragRotating;
|
|
||||||
|
|
||||||
public Cursor()
|
public Cursor()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
@ -149,10 +157,6 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
||||||
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
|
|
||||||
cursorRotate = config.GetBindable<bool> (OsuSetting.CursorRotation);
|
|
||||||
cursorRotate.ValueChanged += newValue => DragRotating = newValue;
|
|
||||||
cursorRotate.TriggerChange();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user