aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt
index e80aa7f62..c9ebdc5a6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt
@@ -20,7 +20,9 @@ class ParkourHelper(
val locations: List<LorenzVec>,
private val shortCuts: List<ShortCut>,
val platformSize: Double = 1.0,
- val detectionRange: Double = 1.0
+ val detectionRange: Double = 1.0,
+ val depth: Boolean = true,
+ val onEndReach: () -> Unit = {}
) {
private var current = -1
private var visible = false
@@ -77,6 +79,9 @@ class ParkourHelper(
}
val inProgressVec = getInProgressPair().toSingletonListOrEmpty()
+ if (locations.size == current + 1) {
+ onEndReach()
+ }
for ((prev, next) in locations.asSequence().withIndex().zipWithNext().drop(current)
.take(lookAhead - 1) + inProgressVec) {
event.draw3DLine_nea(
@@ -98,7 +103,7 @@ class ParkourHelper(
val aabb = axisAlignedBB(locations[shortCut.to])
event.drawFilledBoundingBox_nea(aabb, Color.RED, 1f)
- if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, true)
+ if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, depth)
}
}
@@ -113,7 +118,7 @@ class ParkourHelper(
} else {
val aabb = axisAlignedBB(location)
event.drawFilledBoundingBox_nea(aabb, colorForIndex(index), 1f)
- if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, true)
+ if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, depth)
}
if (SkyHanniMod.feature.dev.waypoint.showPlatformNumber && !isMovingPlatform) {
event.drawString(location.offsetCenter().add(y = 1), "§a§l$index", seeThroughBlocks = true)