diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2023-06-27 21:10:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 21:10:18 +0200 |
commit | 4cf835d53a1f6275bf982b817660d4b597d389d2 (patch) | |
tree | 359ccb8c0322399302d620c91bd4363567b46efc | |
parent | b098e653a25423477bd20052739fea525489db5a (diff) | |
download | skyhanni-4cf835d53a1f6275bf982b817660d4b597d389d2.tar.gz skyhanni-4cf835d53a1f6275bf982b817660d4b597d389d2.tar.bz2 skyhanni-4cf835d53a1f6275bf982b817660d4b597d389d2.zip |
add options to enigma soul waypoints (#268)
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java | 19 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt | 14 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java index a32d8bf84..b4b8fc53c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java @@ -109,6 +109,25 @@ public class RiftConfig { } + @ConfigOption(name = "Enigma Soul Waypoints", desc = "") + @Accordion + @Expose + public EnigmaSoulConfig enigmaSoulWaypoints = new EnigmaSoulConfig(); + + public static class EnigmaSoulConfig { + + @Expose + @ConfigOption(name = "Enabled", desc = "Click on Enigma Souls in Rift Guides to highlight their location.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Color", desc = "Color of the Enigma Souls.") + @ConfigEditorColour + public String color = "0:120:13:49:255"; + + } + @Expose @ConfigOption(name = "Highlight Guide", desc = "Highlight things to do in the Rift Guide.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt index 08cfa0753..8e2129caf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift +import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -25,6 +26,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object EnigmaSoulWaypoints { + private val config get() = SkyHanniMod.feature.rift.enigmaSoulWaypoints private var inInventory = false private val soulLocations = mutableMapOf<String, LorenzVec>() private val trackedSouls = mutableListOf<String>() @@ -45,6 +47,8 @@ object EnigmaSoulWaypoints { @SubscribeEvent fun replaceItem(event: ReplaceItemEvent) { + if (!isEnabled()) return + if (inventoryUnfound.isEmpty()) return if (event.inventory is ContainerLocalMenu && inInventory && event.slotNumber == 31) { event.replaceWith(item) @@ -76,7 +80,7 @@ object EnigmaSoulWaypoints { @SubscribeEvent(priority = EventPriority.HIGH) fun onSlotClick(event: SlotClickEvent) { - if (!inInventory || !RiftAPI.inRift()) return + if (!inInventory || !isEnabled()) return if (event.slotId == 31 && inventoryUnfound.isNotEmpty()) { event.usePickblockInstead() @@ -106,7 +110,7 @@ object EnigmaSoulWaypoints { @SubscribeEvent(priority = EventPriority.LOWEST) fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!RiftAPI.inRift() || !inInventory) return + if (!isEnabled() || !inInventory) return if (event.gui !is GuiChest) return val guiChest = event.gui @@ -129,7 +133,7 @@ object EnigmaSoulWaypoints { @SubscribeEvent fun onRenderWorld(event: RenderWorldLastEvent) { - if (!RiftAPI.inRift()) return + if (!isEnabled()) return for (soul in trackedSouls) { soulLocations[soul]?.let { event.drawWaypointFilled(it, LorenzColor.DARK_PURPLE.toColor(), seeThroughBlocks = true, beacon = true) @@ -152,7 +156,7 @@ object EnigmaSoulWaypoints { @SubscribeEvent fun onChat(event: LorenzChatEvent) { - if (!RiftAPI.inRift()) return + if (!isEnabled()) return val message = event.message.removeColor().trim() if (message == "You have already found that Enigma Soul!" || message == "SOUL! You unlocked an Enigma Soul!") { hideClosestSoul() @@ -174,4 +178,6 @@ object EnigmaSoulWaypoints { LorenzUtils.chat("ยง5Found the $closestSoul Enigma Soul!") } } + + fun isEnabled() = RiftAPI.inRift() && config.enabled }
\ No newline at end of file |