mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Ensure hold for menu button fades out if the cursor is never moved
Closes https://github.com/ppy/osu/discussions/16669.
This commit is contained in:
parent
f32d56e213
commit
28c8e07e3f
@ -60,5 +60,15 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddUntilStep($"{nameof(holdForMenuButton.Action)} was triggered", () => exitAction);
|
||||
AddStep("Release", () => InputManager.ReleaseButton(MouseButton.Left));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFadeOnNoInput()
|
||||
{
|
||||
AddStep("move mouse away", () => InputManager.MoveMouseTo(Vector2.One));
|
||||
AddUntilStep("wait for text fade out", () => !getSpriteText().IsPresent);
|
||||
AddUntilStep("wait for button fade out", () => holdForMenuButton.Alpha < 0.1f);
|
||||
}
|
||||
|
||||
private SpriteText getSpriteText() => holdForMenuButton.Children.OfType<SpriteText>().First();
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
private float positionalAdjust;
|
||||
private float positionalAdjust = 1; // Start at 1 to handle the case where a user never send positional input.
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user