diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-01-30 18:22:49 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-01-30 18:22:49 +0800 |
| commit | 3290259e39e9816fd92afa85710de01a6ddfa3b9 (patch) | |
| tree | e105bcfccfbc38f091848a94667dd612271eed7c /src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java | |
| parent | 659a0e4981640802058d9eef35fec16fab82c5f2 (diff) | |
| download | notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.gz notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.bz2 notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.zip | |
PRE13.2
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java | 31 |
1 files changed, 30 insertions, 1 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 d870e858..0b00cd5a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java @@ -55,15 +55,44 @@ public class NEUConfigEditor extends GuiElement { private LinkedHashMap<String, ConfigProcessor.ProcessedCategory> processedConfig; public NEUConfigEditor(Config config) { + this(config, null); + } + + public NEUConfigEditor(Config config, String categoryOpen) { this.openedMillis = System.currentTimeMillis(); this.processedConfig = ConfigProcessor.create(config); + + if(categoryOpen != null) { + for(String category : processedConfig.keySet()) { + if(category.equalsIgnoreCase(categoryOpen)) { + selectedCategory = category; + break; + } + } + if(selectedCategory == null) { + for(String category : processedConfig.keySet()) { + if(category.toLowerCase().startsWith(categoryOpen.toLowerCase())) { + selectedCategory = category; + break; + } + } + } + if(selectedCategory == null) { + for(String category : processedConfig.keySet()) { + if(category.toLowerCase().contains(categoryOpen.toLowerCase())) { + selectedCategory = category; + break; + } + } + } + } } private LinkedHashMap<String, ConfigProcessor.ProcessedCategory> getCurrentConfigEditing() { return processedConfig; } - private String getSelectedCategory() { + public String getSelectedCategory() { return selectedCategory; } |
