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

Handle hover blocking in VolumeOverlay to ensure correct hide scheduling

This commit is contained in:
Dean Herbert 2018-06-13 16:46:48 +09:00
parent 2a18625b2c
commit a55bf82fd9
2 changed files with 8 additions and 3 deletions

View File

@ -221,7 +221,7 @@ namespace osu.Game.Overlays.Volume
protected override bool OnHover(InputState state)
{
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
return true;
return false;
}
protected override void OnHoverLost(InputState state)

View File

@ -142,13 +142,18 @@ namespace osu.Game.Overlays
return base.OnMouseMove(state);
}
protected override bool OnHover(InputState state)
{
Show();
return true;
}
private void schedulePopOut()
{
popOutDelegate?.Cancel();
this.Delay(1000).Schedule(() =>
{
// only actually hide if the mouse isn't within our bounds.
if (!ScreenSpaceDrawQuad.Contains(GetContainingInputManager().CurrentState.Mouse.Position))
if (!IsHovered)
Hide();
}, out popOutDelegate);
}