1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-05 13:42:59 +08:00

Add cursor rotation on right mouse button

This commit is contained in:
Power Maker 2020-06-02 20:55:21 +02:00 committed by GitHub
parent a3e31adbf9
commit a2fdf94483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,10 +83,13 @@ namespace osu.Game.Graphics.Cursor
activeCursor.AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
}
if (e.Button == MouseButton.Left && cursorRotate.Value)
if ((e.Button == MouseButton.Left || e.Button == MouseButton.Right) && cursorRotate.Value)
{
dragRotationState = DragRotationState.DragStarted;
positionMouseDown = e.MousePosition;
if(!(dragRotationState == DragRotationState.Rotating))
{
positionMouseDown = e.MousePosition;
dragRotationState = DragRotationState.DragStarted;
}
}
return base.OnMouseDown(e);
@ -94,13 +97,13 @@ namespace osu.Game.Graphics.Cursor
protected override void OnMouseUp(MouseUpEvent e)
{
if (!e.IsPressed(MouseButton.Left) && !e.IsPressed(MouseButton.Right))
if (!e.IsPressed(MouseButton.Left) && !e.IsPressed(MouseButton.Middle) && !e.IsPressed(MouseButton.Right))
{
activeCursor.AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint);
activeCursor.ScaleTo(1, 500, Easing.OutElastic);
}
if (e.Button == MouseButton.Left)
if (!e.IsPressed(MouseButton.Left) && !e.IsPressed(MouseButton.Right))
{
if (dragRotationState == DragRotationState.Rotating)
activeCursor.RotateTo(0, 600 * (1 + Math.Abs(activeCursor.Rotation / 720)), Easing.OutElasticHalf);