Skip to content

Commit

Permalink
Merge pull request ppy#27192 from smoogipoo/mod-search-ignore-whitespace
Browse files Browse the repository at this point in the history
Adjust search terms for mods
  • Loading branch information
bdach authored Feb 22, 2024
2 parents 7388576 + b08fcbd commit 6770b73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public void TestColumnHidingOnTextFilterChange()
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));

AddStep("set search", () => modSelectOverlay.SearchTerm = "HD");
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 1);
AddAssert("two columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);

AddStep("filter out everything", () => modSelectOverlay.SearchTerm = "Some long search term with no matches");
AddAssert("no columns visible", () => this.ChildrenOfType<ModColumn>().All(col => !col.IsPresent));
Expand All @@ -812,7 +812,7 @@ public void TestHidingOverlayClearsTextSearch()
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));

AddStep("set search", () => modSelectOverlay.SearchTerm = "fail");
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);
AddAssert("one column visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 1);

AddStep("hide", () => modSelectOverlay.Hide());
AddStep("show", () => modSelectOverlay.Show());
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Overlays/Mods/ModPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ protected override void Deselect()
/// <seealso cref="ModState.Visible"/>
public bool Visible => modState.Visible;

public override IEnumerable<LocalisableString> FilterTerms => new[]
public override IEnumerable<LocalisableString> FilterTerms => new LocalisableString[]
{
Mod.Name,
Mod.Name.Replace(" ", string.Empty),
Mod.Acronym,
Mod.Description
};

public override bool MatchingFilter
Expand Down

0 comments on commit 6770b73

Please sign in to comment.