From 8286d3896f4240ad920f94bf7e5735230d90d588 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Dec 2023 11:17:32 +0900 Subject: [PATCH] Fix searching at song select matching incorrect ruleset Regressed with https://github.com/ppy/osu/pull/25679. --- .../SongSelect/TestScenePlaySongSelect.cs | 18 ++++++++++++++++++ .../Screens/Select/Carousel/CarouselBeatmap.cs | 2 ++ 2 files changed, 20 insertions(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 7313bde8fe..84750d4c16 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -580,6 +580,24 @@ namespace osu.Game.Tests.Visual.SongSelect AddAssert("start not requested", () => !startRequested); } + [Test] + public void TestSearchTextWithRulesetCriteria() + { + createSongSelect(); + + addRulesetImportStep(0); + + AddStep("disallow convert display", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, false)); + + AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo != null); + + AddStep("set filter to match all", () => songSelect!.FilterControl.CurrentTextSearch.Value = "Some"); + + changeRuleset(1); + + AddUntilStep("has no selection", () => songSelect!.Carousel.SelectedBeatmapInfo == null); + } + [TestCase(false)] [TestCase(true)] public void TestExternalBeatmapChangeWhileFiltered(bool differentRuleset) diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs index 45594bd0e8..1ca4b371c3 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs @@ -41,6 +41,8 @@ namespace osu.Game.Screens.Select.Carousel return match; } + if (!match) return false; + if (criteria.SearchTerms.Length > 0) { match = BeatmapInfo.Match(criteria.SearchTerms);