From f9f192ce3439a5649cf86ee091d3b01dcc4a93d3 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 2 Jul 2018 16:28:05 +0900 Subject: [PATCH] Modify MenuCursor hightlight animation --- osu.Game/Graphics/Cursor/MenuCursor.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 0bb33930b0..14a976f0c0 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -68,11 +68,15 @@ namespace osu.Game.Graphics.Cursor protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { - ActiveCursor.Scale = new Vector2(1); - ActiveCursor.ScaleTo(0.90f, 800, Easing.OutQuint); + // only trigger animation for main mouse buttons + if (args.Button <= MouseButton.Right) + { + ActiveCursor.Scale = new Vector2(1); + ActiveCursor.ScaleTo(0.90f, 800, Easing.OutQuint); - ((Cursor)ActiveCursor).AdditiveLayer.Alpha = 0; - ((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint); + ((Cursor)ActiveCursor).AdditiveLayer.Alpha = 0; + ((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint); + } if (args.Button == MouseButton.Left && cursorRotate) { @@ -86,7 +90,7 @@ namespace osu.Game.Graphics.Cursor { if (!state.Mouse.HasMainButtonPressed) { - ((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, Easing.OutQuint); + ((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint); ActiveCursor.ScaleTo(1, 500, Easing.OutElastic); } @@ -99,13 +103,6 @@ namespace osu.Game.Graphics.Cursor return base.OnMouseUp(state, args); } - protected override bool OnClick(InputState state) - { - ((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint); - - return base.OnClick(state); - } - protected override void PopIn() { ActiveCursor.FadeTo(1, 250, Easing.OutQuint);