@@ -50,6 +50,8 @@ object BlockESP : Module(
5050 private val mesh by setting(" Mesh" , true , " Connect similar adjacent blocks" ) { searchBlocks }.onValueChange(::rebuildMesh)
5151
5252 private val useBlockColor by setting(" Use Block Color" , false , " Use the color of the block instead" ) { searchBlocks }.onValueChange(::rebuildMesh)
53+ private val blockColorAlpha by setting(" Block Color Alpha" , 0.3 , 0.1 .. 1.0 , 0.05 ) { searchBlocks && useBlockColor }.onValueChange { _, _ -> ::rebuildMesh }
54+
5355 private val faceColor by setting(" Face Color" , Color (100 , 150 , 255 , 51 ), " Color of the surfaces" ) { searchBlocks && drawFaces && ! useBlockColor }.onValueChange(::rebuildMesh)
5456 private val outlineColor by setting(" Outline Color" , Color (100 , 150 , 255 , 128 ), " Color of the outlines" ) { searchBlocks && drawOutlines && ! useBlockColor }.onValueChange(::rebuildMesh)
5557 private val outlineWidth by setting(" Outline Width" , 1.0f , 0.5f .. 5.0f , 0.5f ) { searchBlocks && drawOutlines }.onValueChange(::rebuildMesh)
@@ -77,13 +79,15 @@ object BlockESP : Module(
7779 } else DirectionMask .ALL
7880
7981 runSafe {
82+ // TODO: Add custom color option when map options are implemented
8083 val extractedColor = blockColor(state, position.toBlockPos())
84+ val finalColor = Color (extractedColor.red, extractedColor.green, extractedColor.blue, (blockColorAlpha * 255 ).toInt())
8185 val pos = position.toBlockPos()
8286 val shape = state.getOutlineShape(world, pos)
8387 val worldBox = if (shape.isEmpty) Box (pos) else shape.boundingBox.offset(pos)
8488 box(worldBox) {
8589 if (drawFaces)
86- filled(if (useBlockColor) extractedColor else faceColor, sides)
90+ filled(if (useBlockColor) finalColor else faceColor, sides)
8791 if (drawOutlines)
8892 outline(if (useBlockColor) extractedColor else BlockESP .outlineColor, sides, BlockESP .outlineMode, thickness = outlineWidth)
8993 }
0 commit comments