diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-05 11:26:50 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-05 11:26:50 +0100 |
commit | 62f4d8cd10210ea255860f37ffde62180d3400fe (patch) | |
tree | 6f9401c22e8355c249a2f4d06de1920ba20d72b4 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 0c42c67396e2c77bd2dc5db78c1b3199f9f1a532 (diff) | |
download | skyhanni-62f4d8cd10210ea255860f37ffde62180d3400fe.tar.gz skyhanni-62f4d8cd10210ea255860f37ffde62180d3400fe.tar.bz2 skyhanni-62f4d8cd10210ea255860f37ffde62180d3400fe.zip |
Added Deep Caverns Parkour.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt | 11 |
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) |