From 27bfa73de7df93814ca7e60c7d8c25ac6fed6edd Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:05:48 +0100 Subject: 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 --- .../options/separatesections/Mining.java | 21 ++++++++++++++++++++ .../notenoughupdates/overlays/MiningOverlay.java | 23 +++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 @@ -238,6 +238,27 @@ public class Mining { @ConfigAccordionId(id = 2) public boolean starCultDisplayOnlyShowTab = false; + @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", 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; -- cgit