From 8d5efc961206b9789ded5d435c30479f0236a8c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Jul 2023 02:36:24 +0900 Subject: [PATCH 1/4] Add back the ability to close mod select using enter key I've seen this brought up a few times (with people thinking the fact it's not working is a bug) so we'll need to keep this behaviour for now. --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 7ec108e3ec..0b5f263dc7 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -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 nothing is selected, it should exit the dialog (a bit weird, but this is the expectation from stable). if (string.IsNullOrEmpty(SearchTerm)) + { + Hide(); return true; + } ModState? firstMod = columnFlow.Columns.OfType().FirstOrDefault(m => m.IsPresent)?.AvailableMods.FirstOrDefault(x => x.Visible); From f66093d3cf739e267d7a8b9518455477c4830338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 26 Jul 2023 21:49:54 +0200 Subject: [PATCH 2/4] Revert failing test to prior assertions too --- .../Visual/UserInterface/TestSceneModSelectOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 124fedf93a..ad79865ad9 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -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] From 992f78b1582f5fd2483e1f0eae0789a3af334661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 26 Jul 2023 21:54:35 +0200 Subject: [PATCH 3/4] Use more consistent way of closing overlay --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 0b5f263dc7..4c116de3fa 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -641,7 +641,7 @@ namespace osu.Game.Overlays.Mods // If nothing is selected, it should exit the dialog (a bit weird, but this is the expectation from stable). if (string.IsNullOrEmpty(SearchTerm)) { - Hide(); + hideOverlay(true); return true; } From 973e6ded2a9fc54b5085beb13d6ff0b268889f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 26 Jul 2023 21:56:04 +0200 Subject: [PATCH 4/4] Update wrong comment, too --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 4c116de3fa..9e92e9d959 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -638,7 +638,7 @@ namespace osu.Game.Overlays.Mods case GlobalAction.Select: { // Pressing select should select first filtered mod if a search is in progress. - // If nothing is selected, it should exit the dialog (a bit weird, but this is the expectation from stable). + // 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);