summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-09-17 10:28:38 +0200
committerGitHub <noreply@github.com>2024-09-17 10:28:38 +0200
commit1dcc43a3f37591912f086299c298df4e0e471bd9 (patch)
tree1f1682f7ad74848a7569d0e237fb482f73cdf68a /src/main/java/at/hannibal2/skyhanni/features
parentd1bb73a6826b4c56694a47b5811980ec4cdc90af (diff)
downloadskyhanni-1dcc43a3f37591912f086299c298df4e0e471bd9.tar.gz
skyhanni-1dcc43a3f37591912f086299c298df4e0e471bd9.tar.bz2
skyhanni-1dcc43a3f37591912f086299c298df4e0e471bd9.zip
Improvement: More Graph Things (#2515)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
index 67bf84aa9..d91b4008d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.rift.everywhere
+import at.hannibal2.skyhanni.data.IslandGraphs
import at.hannibal2.skyhanni.data.jsonobjects.repo.EnigmaSoulsJson
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
@@ -11,6 +12,7 @@ import at.hannibal2.skyhanni.events.render.gui.ReplaceItemEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.InventoryUtils.getAllItems
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
@@ -46,7 +48,7 @@ object EnigmaSoulWaypoints {
"§5Toggle Missing",
"§7Click here to toggle",
"§7the waypoints for each",
- "§7missing souls on this page"
+ "§7missing souls on this page",
)
}
@@ -97,19 +99,26 @@ object EnigmaSoulWaypoints {
}
if (event.slot?.stack == null) return
+
val split = event.slot.stack.displayName.split("Enigma: ")
- if (split.size == 2) {
- event.makePickblock()
- val name = split.last()
- if (soulLocations.contains(name)) {
- if (!trackedSouls.contains(name)) {
- ChatUtils.chat("§5Tracking the $name Enigma Soul!", prefixColor = "§5")
- trackedSouls.add(name)
- } else {
- trackedSouls.remove(name)
- ChatUtils.chat("§5No longer tracking the $name Enigma Soul!", prefixColor = "§5")
+ if (split.size != 2) return
+
+ event.makePickblock()
+ val name = split.last()
+ if (!soulLocations.contains(name)) return
+
+ if (!trackedSouls.contains(name)) {
+ ChatUtils.chat("§5Tracking the $name Enigma Soul!", prefixColor = "§5")
+ if (config.showPathFinder) {
+ soulLocations[name]?.let {
+ IslandGraphs.pathFind(it, config.color.toChromaColor(), condition = { config.showPathFinder })
}
}
+ trackedSouls.add(name)
+ } else {
+ trackedSouls.remove(name)
+ ChatUtils.chat("§5No longer tracking the $name Enigma Soul!", prefixColor = "§5")
+ IslandGraphs.stop()
}
}
@@ -138,7 +147,7 @@ object EnigmaSoulWaypoints {
if (!isEnabled()) return
for (soul in trackedSouls) {
soulLocations[soul]?.let {
- event.drawWaypointFilled(it, LorenzColor.DARK_PURPLE.toColor(), seeThroughBlocks = true, beacon = true)
+ event.drawWaypointFilled(it, config.color.toChromaColor(), seeThroughBlocks = true, beacon = true)
event.drawDynamicText(it.add(y = 1), "§5${soul.removeSuffix(" Soul")} Soul", 1.5)
}
}