1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-21 09:33:21 +08:00

Modify MenuCursor hightlight animation

This commit is contained in:
ekrctb 2018-07-02 16:28:05 +09:00
parent e37b931a55
commit f9f192ce34

View File

@ -68,11 +68,15 @@ namespace osu.Game.Graphics.Cursor
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
ActiveCursor.Scale = new Vector2(1); // only trigger animation for main mouse buttons
ActiveCursor.ScaleTo(0.90f, 800, Easing.OutQuint); 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.Alpha = 0;
((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint); ((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
}
if (args.Button == MouseButton.Left && cursorRotate) if (args.Button == MouseButton.Left && cursorRotate)
{ {
@ -86,7 +90,7 @@ namespace osu.Game.Graphics.Cursor
{ {
if (!state.Mouse.HasMainButtonPressed) if (!state.Mouse.HasMainButtonPressed)
{ {
((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, Easing.OutQuint); ((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint);
ActiveCursor.ScaleTo(1, 500, Easing.OutElastic); ActiveCursor.ScaleTo(1, 500, Easing.OutElastic);
} }
@ -99,13 +103,6 @@ namespace osu.Game.Graphics.Cursor
return base.OnMouseUp(state, args); 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() protected override void PopIn()
{ {
ActiveCursor.FadeTo(1, 250, Easing.OutQuint); ActiveCursor.FadeTo(1, 250, Easing.OutQuint);