Change spinner action checks to switches

This commit is contained in:
Shane Woolcock
2017-08-16 17:50:24 +09:30
parent ceead888b5
commit b1abf83fee

View File

@ -75,16 +75,30 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public bool OnPressed(OsuAction action)
{
actionLeftButtonPressed |= action == OsuAction.LeftButton;
actionRightButtonPressed |= action == OsuAction.RightButton;
switch (action)
{
case OsuAction.LeftButton:
actionLeftButtonPressed = true;
break;
case OsuAction.RightButton:
actionRightButtonPressed = true;
break;
}
Tracking = actionLeftButtonPressed || actionRightButtonPressed;
return false;
}
public bool OnReleased(OsuAction action)
{
actionLeftButtonPressed &= action == OsuAction.LeftButton;
actionRightButtonPressed &= action == OsuAction.RightButton;
switch (action)
{
case OsuAction.LeftButton:
actionLeftButtonPressed = false;
break;
case OsuAction.RightButton:
actionRightButtonPressed = false;
break;
}
Tracking = actionLeftButtonPressed || actionRightButtonPressed;
return false;
}