Add key binding to deselect all mods

Defaults to `Backspace`.
This commit is contained in:
Dean Herbert
2022-05-15 02:39:54 +09:00
parent 6e74244022
commit a759cf2dab
4 changed files with 30 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
@ -416,6 +416,22 @@ namespace osu.Game.Tests.Visual.UserInterface
AddAssert("unimplemented mod panel is filtered", () => getPanelForMod(typeof(TestUnimplementedMod)).Filtered.Value);
}
[Test]
public void TestDeselectAllViaKey()
{
createScreen();
changeRuleset(0);
AddStep("select DT + HD", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime(), new OsuModHidden() });
AddAssert("DT + HD selected", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
AddStep("press bakcspace", () =>
{
InputManager.Key(Key.BackSpace);
});
AddUntilStep("all mods deselected", () => !SelectedMods.Value.Any());
}
[Test]
public void TestDeselectAllViaButton()
{