From fbf651d95e0a5b1b138511e7cd899bc4d663a83a Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 23 May 2023 18:35:32 +1000 Subject: Made searching an item within an accordion show everything in the accordion (#687) made searching an item within an accordion show everything in the accordion --- .../github/moulberry/notenoughupdates/options/NEUConfigEditor.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java index 677e5822..2b12118c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java @@ -225,13 +225,19 @@ public class NEUConfigEditor extends GuiElement { if (searchedOptions == null) { searchedOptions = new HashSet<>(); } else { + Set searchedOptions2 = new HashSet<>(); for (ConfigProcessor.ProcessedOption option : searchedOptions) { ConfigProcessor.ProcessedCategory cat = categoryForOption.get(option); if (cat == null) continue; searchedCategories.add(cat); + for (ConfigProcessor.ProcessedOption catOption : cat.options.values()) { + if (catOption.accordionId == -1 || option.accordionId == -1) continue; + if (catOption.accordionId == option.accordionId) searchedOptions2.add(catOption); + } searchedAccordions.computeIfAbsent(cat, k -> new HashSet<>()).add(option.accordionId); } + searchedOptions.addAll(searchedOptions2); } } } -- cgit