diff options
author | Cow <cow@volloeko.de> | 2021-08-02 21:27:52 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-08-02 21:27:52 +0200 |
commit | 589b94d1c7a1a648402d62c6c097b2394bff3d1d (patch) | |
tree | 2f9c9986a2cfb3356a0996f2b97c6c3cf58494fa | |
parent | 93576728a754b36b7f139d6c45bcbf2ec203d441 (diff) | |
download | Cowlection-589b94d1c7a1a648402d62c6c097b2394bff3d1d.tar.gz Cowlection-589b94d1c7a1a648402d62c6c097b2394bff3d1d.tar.bz2 Cowlection-589b94d1c7a1a648402d62c6c097b2394bff3d1d.zip |
Added magic word 'new' to list new config options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java | 18 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java | 2 |
3 files changed, 17 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bbffd42..4b944cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - must be enabled in `/moo config > General > Copy inventories with CTRL + C` first - changed 'copy whole inventory' keybinding to <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>C</kbd> (with <kbd>SHIFT</kbd>) - New config options for older features: + - ▶ `/moo config new`: show all new or changed config options - Output of `/moo waila` and copied inventory data can now also be saved to files, instead of being copied to clipboard - Bazaar: order 'Sell Inventory/Sacks Now' tooltips ascending or descending - MC Log file search (`/moo search`): maximum log file size to analyze diff --git a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java index 19dd4a9..8fdd694 100644 --- a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java +++ b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java @@ -1,6 +1,7 @@ package de.cowtipper.cowlection.config.gui; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import de.cowtipper.cowlection.Cowlection; import de.cowtipper.cowlection.config.MooConfig; import de.cowtipper.cowlection.config.MooConfigCategory; @@ -49,6 +50,7 @@ public class MooConfigCategoryScrolling extends GuiListExtended { * listEntryIndex => (sub-category) preview */ private final NavigableMap<Integer, MooConfigPreview> listEntriesPreviews; + private final Set<String> newConfigOptions; private MooConfigCategoryScrolling(MooConfigGui parent, Minecraft mc, int marginLeft) { super(mc, parent.width - marginLeft, parent.height, 32, parent.height - 5, 20); @@ -57,6 +59,10 @@ public class MooConfigCategoryScrolling extends GuiListExtended { this.mc = mc; listEntriesPreviews = new TreeMap<>(); + newConfigOptions = Sets.newHashSet("enableCopyInventory", "copyOrSaveWailaAndInventoryData", "maxLogFileSize", "maxLatestLogFileSize", + "chestAnalyzerShowLowestBinItems", "chestAnalyzerShowNoPriceItems", "bazaarSellAllOrderAscDesc", "bazaarShowItemsLeft", + "dungItemQualityShortenNonRandomized", "dungSendPerformanceOnEndScreen", "dungMarkPartiesWithArcher", "dungMarkPartiesWithBerserk", "dungMarkPartiesWithHealer", "dungMarkPartiesWithMage", "dungMarkPartiesWithTank", + "dungPartyFinderRuleEditorSimplified", "dungPartyFinderRuleEditorShowOpenButton", "dungSendWrongFloorWarning", "gotoKeyBindings"); explanations = new HashMap<>(); listEntries = new ArrayList<>(); } @@ -188,14 +194,16 @@ public class MooConfigCategoryScrolling extends GuiListExtended { MooConfigCategory.SubCategory lastSubCategory = null; boolean hasLogSearchBeenAdded = false; int entryNr = 0; + boolean showNewConfigEntries = "new".equalsIgnoreCase(searchQuery); for (MooConfigCategory configCategory : MooConfig.getConfigCategories()) { for (MooConfigCategory.SubCategory subCategory : configCategory.getSubCategories()) { // add config elements for (Property configEntry : subCategory.getConfigEntries()) { // search for search term in config property sub-category name, display name, tooltip - if (StringUtils.containsIgnoreCase(subCategory.getDisplayName(), searchQuery) - || StringUtils.containsIgnoreCase(I18n.format(configEntry.getLanguageKey()), searchQuery) - || StringUtils.containsIgnoreCase(I18n.format(configEntry.getLanguageKey() + ".tooltip"), searchQuery)) { + if ((showNewConfigEntries && newConfigOptions.contains(configEntry.getName())) || + !showNewConfigEntries && (StringUtils.containsIgnoreCase(subCategory.getDisplayName(), searchQuery) + || StringUtils.containsIgnoreCase(I18n.format(configEntry.getLanguageKey()), searchQuery) + || StringUtils.containsIgnoreCase(I18n.format(configEntry.getLanguageKey() + ".tooltip"), searchQuery))) { if (configCategory != lastCategory) { this.listEntries.add(new MooConfigCategoryScrolling.CategoryEntry("" + EnumChatFormatting.RESET + EnumChatFormatting.DARK_GRAY + "Config category: " + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + EnumChatFormatting.UNDERLINE + configCategory.getDisplayName(), false)); lastCategory = configCategory; @@ -220,6 +228,10 @@ public class MooConfigCategoryScrolling extends GuiListExtended { if (labelWidth > this.maxListLabelWidth) { this.maxListLabelWidth = labelWidth; } + if (showNewConfigEntries && newConfigOptions.contains("gotoKeyBindings")) { + this.listEntries.add(new GuiSwitchEntry("gotoKeyBindings", "Controls ↗", () -> mc.displayGuiScreen(new GuiControls(MooConfigCategoryScrolling.this.parent, mc.gameSettings)))); + ++entryNr; + } this.listEntries.add(new GuiSwitchEntry("gotoLogSearchConfig", "Log Search ↗", () -> mc.displayGuiScreen(new GuiSearch("")))); hasLogSearchBeenAdded = true; } else if (hasLogSearchBeenAdded) { diff --git a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java index aff5315..3d676ad 100644 --- a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java +++ b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java @@ -97,7 +97,7 @@ public class MooConfigGui extends GuiScreen { * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ @Override - protected void actionPerformed(GuiButton button) throws IOException { + protected void actionPerformed(GuiButton button) { if (button.enabled) { if (button.id == 6) { // close gui this.mc.displayGuiScreen(null); |