1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 14:53:19 +08:00

Merge pull request #24375 from peppy/add-back-mode-select-enter-close

Add back the ability to close mod select using enter key
This commit is contained in:
Bartłomiej Dach
2023-07-26 22:43:38 +02:00
committed by GitHub
Unverified
2 changed files with 5 additions and 1 deletions
@@ -542,7 +542,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("clear search", () => modSelectOverlay.SearchTerm = string.Empty);
AddStep("press enter", () => InputManager.Key(Key.Enter));
AddAssert("mod select still visible", () => modSelectOverlay.State.Value == Visibility.Visible);
AddAssert("mod select hidden", () => modSelectOverlay.State.Value == Visibility.Hidden);
}
[Test]
@@ -638,8 +638,12 @@ namespace osu.Game.Overlays.Mods
case GlobalAction.Select:
{
// Pressing select should select first filtered mod if a search is in progress.
// If there is no search in progress, it should exit the dialog (a bit weird, but this is the expectation from stable).
if (string.IsNullOrEmpty(SearchTerm))
{
hideOverlay(true);
return true;
}
ModState? firstMod = columnFlow.Columns.OfType<ModColumn>().FirstOrDefault(m => m.IsPresent)?.AvailableMods.FirstOrDefault(x => x.Visible);