diff options
4 files changed, 30 insertions, 7 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 030a2b68e..dc86379b8 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java @@ -251,6 +251,11 @@ public class RiftConfig { public Property<Integer> lookAhead = Property.of(2); @Expose + @ConfigOption(name = "Outline", desc = "Outlines the top edge of the platforms.") + @ConfigEditorBoolean + public boolean outline = true; + + @Expose @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") @ConfigEditorBoolean public Property<Boolean> rainbowColor = Property.of(true); diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt index ba1a16146..12f419a3a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt @@ -61,6 +61,7 @@ class RiftUpsideDownParkour { rainbowColor = config.rainbowColor.get() monochromeColor = config.monochromeColor.get().toChromaColor() lookAhead = config.lookAhead.get() + 1 + outline = config.outline } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index fd74c5d0c..1c663ac52 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.drawFilledBoundingBox import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock +import at.hannibal2.skyhanni.utils.RenderUtils.outlineTopFace import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson import net.minecraft.client.Minecraft import net.minecraftforge.client.event.RenderWorldLastEvent @@ -27,6 +28,7 @@ class ParkourHelper( var rainbowColor = false var monochromeColor: Color = Color.WHITE var lookAhead = 2 + var outline = false var showEverything = false fun inParkour() = current != -1 @@ -92,11 +94,12 @@ class ParkourHelper( val from = locations[shortCut.from].offsetCenter() val to = locations[shortCut.to].offsetCenter() event.draw3DLine(from, to, Color.RED, 3, false) + val textLocation = from.add(to.subtract(from).normalize()) + event.drawDynamicText(textLocation.add(-0.5, 1.0, -0.5), "§cShortcut", 1.8) val aabb = axisAlignedBB(locations[shortCut.to]) event.drawFilledBoundingBox(aabb, Color.RED, 1f) - val textLocation = from.add(to.subtract(from).normalize()) - event.drawDynamicText(textLocation.add(-0.5, 1.0, -0.5), "§cShortcut", 1.8) + if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, true) } } @@ -105,11 +108,14 @@ class ParkourHelper( .take(lookAhead) + inProgressVec.map { it.second }) { val isMovingPlatform = location !in locations if (isMovingPlatform && showEverything) continue - val aabb = if (isMovingPlatform) { - axisAlignedBB(location).expandBlock() - } else axisAlignedBB(location) - - event.drawFilledBoundingBox(aabb, colorForIndex(index), 1f) + if (isMovingPlatform) { + val aabb = axisAlignedBB(location).expandBlock() + event.drawFilledBoundingBox(aabb, colorForIndex(index), .6f) + } else { + val aabb = axisAlignedBB(location) + event.drawFilledBoundingBox(aabb, colorForIndex(index), 1f) + if (outline) event.outlineTopFace(aabb, 2, Color.BLACK, true) + } if (SkyHanniMod.feature.dev.waypoint.showPlatformNumber) { if (!isMovingPlatform) { event.drawString(location.offsetCenter().add(0, 1, 0), "§a§l$index", seeThroughBlocks = true) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index c4a4239c3..66cbb79b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -800,6 +800,17 @@ object RenderUtils { drawFilledBoundingBox(aabb, c, alphaMultiplier, renderRelativeToCamera, drawVerticalBarriers, partialTicks) } + fun RenderWorldLastEvent.outlineTopFace(boundingBox: AxisAlignedBB, lineWidth: Int, colour: Color, depth: Boolean) { + val cornerOne = LorenzVec(boundingBox.minX, boundingBox.maxY, boundingBox.minZ) + val cornerTwo = LorenzVec(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ) + val cornerThree = LorenzVec(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ) + val cornerFour = LorenzVec(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ) + this.draw3DLine(cornerOne, cornerTwo, colour, lineWidth, depth) + this.draw3DLine(cornerTwo, cornerThree, colour, lineWidth, depth) + this.draw3DLine(cornerThree, cornerFour, colour, lineWidth, depth) + this.draw3DLine(cornerFour, cornerOne, colour, lineWidth, depth) + } + fun RenderWorldLastEvent.draw3DLine( p1: LorenzVec, p2: LorenzVec, color: Color, lineWidth: Int, depth: Boolean, targetColor: Color? = null ) { |