1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 12:43:16 +08:00

Show UI mouse cursor when hovering volume meters during gameplay

Also adds a hover animation.
This commit is contained in:
Dean Herbert 2018-06-07 01:13:35 +09:00
parent 1d5a773399
commit dd75cd973b

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
@ -189,5 +190,18 @@ namespace osu.Game.Overlays.Volume
}
public bool OnReleased(GlobalAction action) => false;
private const float transition_length = 500;
protected override bool OnHover(InputState state)
{
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
return true;
}
protected override void OnHoverLost(InputState state)
{
this.ScaleTo(1f, transition_length, Easing.OutExpo);
}
}
}