1818package com.lambda.module.modules.render
1919
2020import com.lambda.config.applyEdits
21+ import com.lambda.config.groups.OutlineSettings
2122import com.lambda.config.groups.WorldLineSettings
2223import com.lambda.event.events.TickEvent
2324import com.lambda.event.listener.SafeListener.Companion.listen
@@ -36,25 +37,32 @@ object BlockOutline : Module(
3637 description = " Overrides the default block outline rendering" ,
3738 tag = ModuleTag .RENDER
3839) {
39- private val fill by setting(" Fill" , true )
40- private val fillColor by setting(" Fill Color" , Color (255 , 255 , 255 , 20 )) { fill }
41- private val outline by setting(" Outline" , true )
42- private val outlineColor by setting(" Outline Color" , Color (255 , 255 , 255 , 120 )) { outline }
43- private val lineConfig = WorldLineSettings (" Outline " , this ) { outline }.apply {
40+ private val mode by setting(" Mode" , Mode .Boxes )
41+ private val fill by setting(" Fill" , true ) { mode == Mode .Boxes }
42+ private val fillColor by setting(" Fill Color" , Color (255 , 255 , 255 , 20 )) { fill && mode == Mode .Boxes }
43+ private val boxOutline by setting(" Box Outline" , true ) { mode == Mode .Boxes }
44+ private val boxOutlineColor by setting(" Box Outline Color" , Color (255 , 255 , 255 , 120 )) { boxOutline && mode == Mode .Boxes }
45+ private val lineConfig = WorldLineSettings (" Outline " , this ) { boxOutline && mode == Mode .Boxes }.apply {
4446 applyEdits {
4547 hide(::startColor, ::endColor)
4648 }
4749 }
48- private val interpolate by setting(" Interpolate" , true )
49- private val esp by setting(" ESP" , true )
50+ private val interpolate by setting(" Interpolate" , true ) { mode == Mode .Boxes }
51+ private val outlineColor by setting(" Outline Color" , boxOutlineColor) { mode == Mode .Outline }
52+ private val outlineStyle = OutlineSettings (" Outline" , this ) { mode == Mode .Outline }
53+ private val depthTest by setting(" Depth Test" , true )
5054
5155 var previous: List <Box >? = null
5256
5357 init {
54- immediateRenderer(" BlockOutline Immediate Renderer" , depthTest = { ! esp }) { safeContext ->
58+ immediateRenderer(" BlockOutline Immediate Renderer" , depthTest = { ! depthTest }) { safeContext ->
5559 with (safeContext) {
56- val hitResult = mc.crosshairTarget?.blockResult ? : return @immediateRenderer
60+ val hitResult = mc.crosshairTarget?.blockResult ? : return @with
5761 val pos = hitResult.blockPos
62+ if (mode == Mode .Outline ) {
63+ worldOutline(pos, outlineStyle.toStyle(outlineColor))
64+ return @with
65+ }
5866 val blockState = blockState(pos)
5967 val boxes = blockState
6068 .getOutlineShape(world, pos)
@@ -72,9 +80,9 @@ object BlockOutline : Module(
7280
7381 boxes.forEach { box ->
7482 box(box, lineConfig) {
75- colors(fillColor, outlineColor )
83+ colors(fillColor, boxOutlineColor )
7684 if (! fill) hideFill()
77- if (! outline ) hideOutline()
85+ if (! boxOutline ) hideOutline()
7886 }
7987 }
8088 }
@@ -88,4 +96,9 @@ object BlockOutline : Module(
8896 .map { it.offset(hitResult.blockPos) }
8997 }
9098 }
99+
100+ private enum class Mode {
101+ Boxes ,
102+ Outline
103+ }
91104}
0 commit comments