mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Add failing test showing hold for menu not working when HUD is hidden
This commit is contained in:
parent
f5e11343c2
commit
8399261c77
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -148,6 +149,41 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddAssert("key counters still hidden", () => !keyCounterFlow.IsPresent);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHoldForMenuDoesWorkWhenHidden()
|
||||
{
|
||||
bool activated = false;
|
||||
|
||||
HoldForMenuButton getHoldForMenu() => hudOverlay.ChildrenOfType<HoldForMenuButton>().Single();
|
||||
|
||||
createNew();
|
||||
|
||||
AddStep("bind action", () =>
|
||||
{
|
||||
activated = false;
|
||||
|
||||
var holdForMenu = getHoldForMenu();
|
||||
|
||||
holdForMenu.Action += () => activated = true;
|
||||
});
|
||||
|
||||
AddStep("set showhud false", () => hudOverlay.ShowHud.Value = false);
|
||||
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
||||
|
||||
AddStep("attempt activate", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(getHoldForMenu().OfType<HoldToConfirmContainer>().Single());
|
||||
InputManager.PressButton(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddUntilStep("activated", () => activated);
|
||||
|
||||
AddStep("release mouse button", () =>
|
||||
{
|
||||
InputManager.ReleaseButton(MouseButton.Left);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInputDoesntWorkWhenHUDHidden()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user