From f5c472c0fe8a2a2bd9f4d9305be46353119dfce0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 17:36:52 +0900 Subject: [PATCH] Don't hide mod select overlay when pressing select binding with no search --- .../Visual/UserInterface/TestSceneModSelectOverlay.cs | 2 +- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 4cb6899ebc..9561a8875c 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 hidden", () => modSelectOverlay.State.Value == Visibility.Hidden); + AddAssert("mod select still visible", () => modSelectOverlay.State.Value == Visibility.Visible); } [Test] diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 9035503723..c09668850a 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -48,7 +48,8 @@ namespace osu.Game.Overlays.Mods /// Contrary to and , the instances /// inside the objects are owned solely by this instance. /// - public Bindable>> AvailableMods { get; } = new Bindable>>(new Dictionary>()); + public Bindable>> AvailableMods { get; } = + new Bindable>>(new Dictionary>()); private Func isValidMod = _ => true; @@ -636,12 +637,9 @@ namespace osu.Game.Overlays.Mods case GlobalAction.Select: { - // Pressing select should select first filtered mod or completely hide the overlay in one shot if search term is empty. + // Pressing select should select first filtered mod if a search is in progress. if (string.IsNullOrEmpty(SearchTerm)) - { - hideOverlay(true); return true; - } ModState? firstMod = columnFlow.Columns.OfType().FirstOrDefault(m => m.IsPresent)?.AvailableMods.FirstOrDefault(x => x.Visible);