diff options
author | jani270 <69345714+jani270@users.noreply.github.com> | 2023-12-14 18:05:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 18:05:48 +0100 |
commit | 27bfa73de7df93814ca7e60c7d8c25ac6fed6edd (patch) | |
tree | a468fc1843eb78503071a855556a8bdb76364c25 /src | |
parent | 4f487f0fb54f7e239fa5298f55ed3011150c4677 (diff) | |
download | NotEnoughUpdates-27bfa73de7df93814ca7e60c7d8c25ac6fed6edd.tar.gz NotEnoughUpdates-27bfa73de7df93814ca7e60c7d8c25ac6fed6edd.tar.bz2 NotEnoughUpdates-27bfa73de7df93814ca7e60c7d8c25ac6fed6edd.zip |
Added option to show skymall perk outside of mining islands and fixed skymall showing the wrong perk (#965)
* Fixed Skymall showing wrong perk
* Added option to show skymall perk outside of mining islands
* Fixed upsi
Diffstat (limited to 'src')
3 files changed, 43 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java index de65f3e9..38aefcaf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java @@ -240,6 +240,27 @@ public class Mining { @Expose @ConfigOption( + name = "Sky Mall Location", + desc = "Change when the Sky Mall perk gets shown" + ) + @ConfigEditorDropdown( + values = {"Dwarven Mines+Crystal Hollows", "Everywhere except dungeons", "Everywhere"} + ) + @ConfigAccordionId(id = 2) + public int skyMallDisplayEnabledLocations = 0; + + @Expose + @ConfigOption( + name = "Sky Mall Tab", + desc = "Only show the Sky Mall perk when tab list is open\n" + + "§cThis only works outside of Dwarven Caves!" + ) + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean skyMallDisplayOnlyShowTab = false; + + @Expose + @ConfigOption( name = "Commission Task Tips", desc = "Show tips to help complete commission tasks" ) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index 2f0388f4..f479276a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -46,7 +46,6 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -456,6 +455,7 @@ public class MiningOverlay extends TextTabOverlay { } boolean forgeDisplay = false; boolean starCultDisplay = false; + boolean skyMallDisplay = false; for (int i = 0; i < NotEnoughUpdates.INSTANCE.config.mining.dwarvenText2.size(); i++) { if (NotEnoughUpdates.INSTANCE.config.mining.dwarvenText2.get(i) == 3) { forgeDisplay = true; @@ -463,6 +463,9 @@ public class MiningOverlay extends TextTabOverlay { if (NotEnoughUpdates.INSTANCE.config.mining.dwarvenText2.get(i) == 5) { starCultDisplay = true; } + if (NotEnoughUpdates.INSTANCE.config.mining.dwarvenText2.get(i) == 6) { + skyMallDisplay = true; + } } if (starCultDisplay) { @@ -496,6 +499,24 @@ public class MiningOverlay extends TextTabOverlay { } } } + + if (skyMallDisplay) { + if (overlayStrings == null) overlayStrings = new ArrayList<>(); + + if (!NotEnoughUpdates.INSTANCE.config.mining.skyMallDisplayOnlyShowTab || + lastTabState) { + if (NotEnoughUpdates.INSTANCE.config.mining.skyMallDisplayEnabledLocations == 1 && + !SBInfo.getInstance().isInDungeon) { + overlayStrings.add( + DARK_AQUA + "Sky Mall: " + GREEN + + SkyMallDisplay.Companion.getDisplayText()); + } else if (NotEnoughUpdates.INSTANCE.config.mining.skyMallDisplayEnabledLocations == 2) { + overlayStrings.add( + DARK_AQUA + "Sky Mall: " + GREEN + + SkyMallDisplay.Companion.getDisplayText()); + } + } + } } if (overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/guifeatures/SkyMallDisplay.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/guifeatures/SkyMallDisplay.kt index 2332da13..cfc47d1a 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/guifeatures/SkyMallDisplay.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/guifeatures/SkyMallDisplay.kt @@ -40,7 +40,6 @@ class SkyMallDisplay { @SubscribeEvent(receiveCanceled = true) fun onChatReceive(event: ClientChatReceivedEvent) { if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return - if (SBInfo.getInstance().getLocation() != "mining_3" && SBInfo.getInstance().getLocation() != "crystal_hollows") return val matcher = pattern.matcher(event.message.formattedText) if (!matcher.matches()) return |