aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-22 22:33:37 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-22 22:33:37 +0100
commitdd4af6dfad107af2fc73dfdf0772fddfd849a58e (patch)
treea8db55e1770468ece458c528841cba5ff7c1f3f8 /src/main/java
parentdae9cafbcbd46751311d377b38b4d9ccf3e8f51b (diff)
downloadskyhanni-dd4af6dfad107af2fc73dfdf0772fddfd849a58e.tar.gz
skyhanni-dd4af6dfad107af2fc73dfdf0772fddfd849a58e.tar.bz2
skyhanni-dd4af6dfad107af2fc73dfdf0772fddfd849a58e.zip
Fixed and improved Inquisitor waypoint share feature.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt23
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt4
2 files changed, 21 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
index 5d53ce823..5d7971d0f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
@@ -46,6 +46,7 @@ object GriffinBurrowHelper {
private var guessLocation: LorenzVec? = null
private var particleBurrows = mapOf<LorenzVec, BurrowType>()
var lastTitleSentTime = SimpleTimeMark.farPast()
+ private var shouldFocusOnInquis = false
@SubscribeEvent
fun onDebugDataCollect(event: DebugDataCollectEvent) {
@@ -74,16 +75,26 @@ object GriffinBurrowHelper {
update()
}
- private fun update() {
+ fun update() {
if (config.burrowsNearbyDetection) {
checkRemoveGuess()
}
- val locations = particleBurrows.keys.toMutableList()
- guessLocation?.let {
- locations.add(findBlock(it))
+ val locations = mutableListOf<LorenzVec>()
+
+ if (config.inquisitorSharing.enabled) {
+ for (waypoint in InquisitorWaypointShare.waypoints) {
+ locations.add(waypoint.value.location)
+ }
+ }
+ shouldFocusOnInquis = config.inquisitorSharing.focusInquisitor && locations.isNotEmpty()
+ if (!shouldFocusOnInquis) {
+ locations.addAll(particleBurrows.keys.toMutableList())
+ guessLocation?.let {
+ locations.add(findBlock(it))
+ }
+ locations.addAll(InquisitorWaypointShare.waypoints.values.map { it.location })
}
- locations.addAll(InquisitorWaypointShare.waypoints.values.map { it.location })
targetLocation = locations.minByOrNull { it.distanceToPlayer() }
if (config.burrowNearestWarp) {
@@ -219,7 +230,7 @@ object GriffinBurrowHelper {
color = LorenzColor.AQUA
currentWarp.location
} else {
- color = LorenzColor.WHITE
+ color = if (shouldFocusOnInquis) LorenzColor.LIGHT_PURPLE else LorenzColor.WHITE
targetLocation?.add(0.5, 0.5, 0.5) ?: return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt
index d9ff8885f..bd8d5a210 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt
@@ -129,6 +129,7 @@ object InquisitorWaypointShare {
logger.log("FOUND: $name")
inquisitorsNearby = inquisitorsNearby.editCopy { add(entity) }
+ GriffinBurrowHelper.update()
val diff = System.currentTimeMillis() - time
time = System.currentTimeMillis()
@@ -251,6 +252,7 @@ object InquisitorWaypointShare {
}
val inquis = SharedInquisitor(name, displayName, location, SimpleTimeMark.now())
waypoints = waypoints.editCopy { this[name] = inquis }
+ GriffinBurrowHelper.update()
event.isCanceled = true
}
@@ -259,6 +261,7 @@ object InquisitorWaypointShare {
val name = rawName.cleanPlayerName()
val displayName = rawName.cleanPlayerName(displayName = true)
waypoints = waypoints.editCopy { remove(name) }
+ GriffinBurrowHelper.update()
logger.log("Inquisitor died from '$displayName'")
}
}
@@ -268,6 +271,7 @@ object InquisitorWaypointShare {
fun maybeRemove(inquis: SharedInquisitor) {
if (inquisitorsNearby.isEmpty()) {
waypoints = waypoints.editCopy { remove(inquis.fromPlayer) }
+ GriffinBurrowHelper.update()
ChatUtils.chat("Inquisitor from ${inquis.displayName} not found, deleting.")
}
}