From 6121f3b19558ec3caf1b11acdc0eb440e424b20e Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 9 Sep 2023 20:07:59 +0200 Subject: [PATCH] Add option to recalculate the option universe --- .../moulberry/moulconfig/gui/MoulConfigEditor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/io/github/moulberry/moulconfig/gui/MoulConfigEditor.java b/src/main/java/io/github/moulberry/moulconfig/gui/MoulConfigEditor.java index 2f0a42989..16de22365 100644 --- a/src/main/java/io/github/moulberry/moulconfig/gui/MoulConfigEditor.java +++ b/src/main/java/io/github/moulberry/moulconfig/gui/MoulConfigEditor.java @@ -122,6 +122,16 @@ private void propagateSearchinessForAccordions(Set options, Set } public void updateSearchResults() { + updateSearchResults(false); + } + + public void updateSearchResults(boolean recalculateOptionUniverse) { + if(recalculateOptionUniverse){ + allOptions.clear(); + for (ProcessedCategory category : processedConfig.getAllCategories().values()) { + allOptions.addAll(category.options); + } + } String toSearch = searchField.getText().trim().toLowerCase(Locale.ROOT); if (!toSearch.isEmpty()) { Set matchingOptions = new HashSet<>(allOptions);