1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 18:19:54 +08:00

Merge pull request #1110 from swoolcock/fix-spinner-ignoring-actions

Fix spinner not handling left/right action bindings
This commit is contained in:
Dean Herbert
2017-08-18 19:31:22 +09:00
committed by GitHub
Unverified
4 changed files with 12 additions and 14 deletions
@@ -51,6 +51,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected virtual void UpdateCurrentState(ArmedState state)
{
}
private OsuInputManager osuActionInputManager;
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
}
public enum ComboResult
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@@ -165,6 +166,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
glow.Colour = colours.BlueDark;
}
protected override void Update()
{
disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton);
base.Update();
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
@@ -66,21 +66,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
}
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
Tracking |= state.Mouse.HasMainButtonPressed;
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
Tracking &= state.Mouse.HasMainButtonPressed;
return base.OnMouseUp(state, args);
}
protected override bool OnMouseMove(InputState state)
{
Tracking |= state.Mouse.HasMainButtonPressed;
mousePosition = Parent.ToLocalSpace(state.Mouse.NativeState.Position);
return base.OnMouseMove(state);
}