diff options
Diffstat (limited to 'src/main')
5 files changed, 59 insertions, 21 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java index 8da4bb41..6ddbdf65 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java @@ -407,8 +407,8 @@ public class SkyblockerConfig implements ConfigData { } public static class Dungeons { - public boolean secretWaypoints = true; - public boolean noInitSecretWaypoints = false; + @ConfigEntry.Gui.CollapsibleObject + public SecretWaypoints secretWaypoints = new SecretWaypoints(); @ConfigEntry.Gui.Tooltip() public boolean croesusHelper = true; public boolean enableMap = true; @@ -429,6 +429,24 @@ public class SkyblockerConfig implements ConfigData { public Terminals terminals = new Terminals(); } + public static class SecretWaypoints { + + public boolean enableSecretWaypoints = true; + @ConfigEntry.Gui.Tooltip() + public boolean noInitSecretWaypoints = false; + public boolean enableEntranceWaypoints = true; + public boolean enableSuperboomWaypoints = true; + public boolean enableChestWaypoints = true; + public boolean enableItemWaypoints = true; + public boolean enableBatWaypoints = true; + public boolean enableWitherWaypoints = true; + public boolean enableLeverWaypoints = true; + public boolean enableFairySoulWaypoints = true; + public boolean enableStonkWaypoints = true; + @ConfigEntry.Gui.Tooltip() + public boolean enableDefaultWaypoints = true; + } + public static class LividColor { @ConfigEntry.Gui.Tooltip() public boolean enableLividColor = true; diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java index 889c2829..11139971 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/DungeonSecrets.java @@ -120,7 +120,7 @@ public class DungeonSecrets { * Use {@link #isRoomsLoaded()} to check for completion of loading. */ public static void init() { - if (SkyblockerConfig.get().locations.dungeons.noInitSecretWaypoints) { + if (SkyblockerConfig.get().locations.dungeons.secretWaypoints.noInitSecretWaypoints) { return; } // Execute with MinecraftClient as executor since we need to wait for MinecraftClient#resourceManager to be set @@ -210,7 +210,7 @@ public class DungeonSecrets { */ @SuppressWarnings("JavadocReference") private static void update() { - if (!SkyblockerConfig.get().locations.dungeons.secretWaypoints) { + if (!SkyblockerConfig.get().locations.dungeons.secretWaypoints.enableSecretWaypoints) { return; } if (!Utils.isInDungeons()) { @@ -378,7 +378,7 @@ public class DungeonSecrets { * @return whether dungeon secrets should be processed */ private static boolean shouldProcess() { - return SkyblockerConfig.get().locations.dungeons.secretWaypoints && Utils.isInDungeons(); + return SkyblockerConfig.get().locations.dungeons.secretWaypoints.enableSecretWaypoints && Utils.isInDungeons(); } /** diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/Room.java index 0904a7f1..383e246d 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/Room.java @@ -324,7 +324,7 @@ public class Room { */ protected void render(WorldRenderContext context) { for (SecretWaypoint secretWaypoint : secretWaypoints.values()) { - if (secretWaypoint.isMissing()) { + if (secretWaypoint.shouldRender()) { secretWaypoint.render(context); } } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java index 96fd7374..73a03fbc 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java @@ -1,6 +1,7 @@ package me.xmrvizzy.skyblocker.skyblock.dungeon.secrets; import com.google.gson.JsonObject; +import me.xmrvizzy.skyblocker.config.SkyblockerConfig; import me.xmrvizzy.skyblocker.utils.RenderHelper; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.minecraft.client.MinecraftClient; @@ -10,6 +11,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import java.util.List; +import java.util.function.Predicate; public class SecretWaypoint { static final List<String> SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman"); @@ -29,8 +31,8 @@ public class SecretWaypoint { this.missing = true; } - public boolean isMissing() { - return missing; + public boolean shouldRender() { + return category.isEnabled() && missing; } public void setFound() { @@ -49,19 +51,21 @@ public class SecretWaypoint { } enum Category { - ENTRANCE(0, 255, 0), - SUPERBOOM(255, 0, 0), - CHEST(2, 213, 250), - ITEM(2, 64, 250), - BAT(142, 66, 0), - WITHER(30, 30, 30), - LEVER(250, 217, 2), - FAIRYSOUL(255, 85, 255), - STONK(146, 52, 235), - DEFAULT(190, 255, 252); + ENTRANCE(secretWaypoints -> secretWaypoints.enableEntranceWaypoints, 0, 255, 0), + SUPERBOOM(secretWaypoints -> secretWaypoints.enableSuperboomWaypoints, 255, 0, 0), + CHEST(secretWaypoints -> secretWaypoints.enableChestWaypoints, 2, 213, 250), + ITEM(secretWaypoints -> secretWaypoints.enableItemWaypoints, 2, 64, 250), + BAT(secretWaypoints -> secretWaypoints.enableBatWaypoints, 142, 66, 0), + WITHER(secretWaypoints -> secretWaypoints.enableWitherWaypoints, 30, 30, 30), + LEVER(secretWaypoints -> secretWaypoints.enableLeverWaypoints, 250, 217, 2), + FAIRYSOUL(secretWaypoints -> secretWaypoints.enableFairySoulWaypoints, 255, 85, 255), + STONK(secretWaypoints -> secretWaypoints.enableStonkWaypoints, 146, 52, 235), + DEFAULT(secretWaypoints -> secretWaypoints.enableDefaultWaypoints, 190, 255, 252); + private final Predicate<SkyblockerConfig.SecretWaypoints> enabledPredicate; private final float[] colorComponents; - Category(int... intColorComponents) { + Category(Predicate<SkyblockerConfig.SecretWaypoints> enabledPredicate, int... intColorComponents) { + this.enabledPredicate = enabledPredicate; colorComponents = new float[intColorComponents.length]; for (int i = 0; i < intColorComponents.length; i++) { colorComponents[i] = intColorComponents[i] / 255F; @@ -90,5 +94,9 @@ public class SecretWaypoint { boolean needsItemPickup() { return this == ITEM || this == BAT; } + + boolean isEnabled() { + return enabledPredicate.test(SkyblockerConfig.get().locations.dungeons.secretWaypoints); + } } } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 842c4591..59cfdcf5 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -199,8 +199,20 @@ "text.autoconfig.skyblocker.option.locations.barn.solveTreasureHunter": "Solve Treasure Hunter", "text.autoconfig.skyblocker.option.locations.dungeons": "Dungeons", "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints": "Dungeon Secret Waypoints", - "text.autoconfig.skyblocker.option.locations.dungeons.noInitSecretWaypoints": "Do Not Initialize Secret Waypoints", - "text.autoconfig.skyblocker.option.locations.dungeons.noInitSecretWaypoints.@Tooltip": "This option can save around 20 MB of ram if enabled, but Secret Waypoint will require a restart after turning off this option to work.", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSecretWaypoints": "Enable Dungeon Secret Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "Do Not Initialize Secret Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "This option can save around 20 MB of ram if enabled, but Secret Waypoint will require a restart after turning off this option to work.", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints" : "Enable Entrance Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints" : "Enable Superboom Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints" : "Enable Chest Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableItemWaypoints" : "Enable Item Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableBatWaypoints" : "Enable Bat Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableWitherWaypoints" : "Enable Wither Essence Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableLeverWaypoints" : "Enable Lever Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableFairySoulWaypoints" : "Enable Fairy Soul Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableStonkWaypoints" : "Enable Stonk Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints" : "Enable Default Waypoints", + "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip" : "This includes all waypoints that do not belong to a category.", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Croesus Helper", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Gray out chests that have already been opened.", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", |