aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-05-23 18:35:32 +1000
committerGitHub <noreply@github.com>2023-05-23 10:35:32 +0200
commitfbf651d95e0a5b1b138511e7cd899bc4d663a83a (patch)
treee280700d32f86d82d8410cefb5f8d6ebe730feba /src/main/java
parentf92a0c9611ce3f70d9896852b71f99cf1986448a (diff)
downloadNotEnoughUpdates-fbf651d95e0a5b1b138511e7cd899bc4d663a83a.tar.gz
NotEnoughUpdates-fbf651d95e0a5b1b138511e7cd899bc4d663a83a.tar.bz2
NotEnoughUpdates-fbf651d95e0a5b1b138511e7cd899bc4d663a83a.zip
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
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java6
1 files changed, 6 insertions, 0 deletions
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<ConfigProcessor.ProcessedOption> 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);
}
}
}