Skip to content

Commit

Permalink
fixes(legacy): Color picker not being visible when Armor element is d…
Browse files Browse the repository at this point in the history
…isabled + fixed duplicate option names. (#5319)
  • Loading branch information
mems01 authored Jan 14, 2025
1 parent 95d5042 commit af39852
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 188 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/ccbluex/liquidbounce/config/Value.kt
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ open class FontValue(

fun previous() {
val fonts = Fonts.fonts
value = fonts[(fonts.indexOf(value) - 1) % fonts.size]
value = fonts[(fonts.indexOf(value) - 1 + fonts.size) % fonts.size]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ object Backtrack : Module("Backtrack", Category.COMBAT, hideModule = false) {
private val espMode by choices("ESP-Mode", arrayOf("None", "Box", "Model", "Wireframe"), "Box", subjective = true) { mode == "Modern" }
private val wireframeWidth by float("WireFrame-Width", 1f, 0.5f..5f) { espMode == "WireFrame" }

private val espColor = ColorSettingsInteger(this, "ESP") { espMode != "Model" && mode == "Modern" }.with(0, 255, 0)
private val espColor = ColorSettingsInteger(this, "ESPColor") { espMode != "Model" && mode == "Modern" }.with(0, 255, 0)

private val packetQueue = ConcurrentLinkedQueue<QueueData>()
private val positions = mutableListOf<Pair<Vec3, Long>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ForwardTrack : Module("ForwardTrack", Category.COMBAT) {
private val espMode by choices("ESP-Mode", arrayOf("Box", "Model", "Wireframe"), "Model", subjective = true)
private val wireframeWidth by float("WireFrame-Width", 1f, 0.5f..5f) { espMode == "WireFrame" }

private val espColor = ColorSettingsInteger(this, "ESP") {espMode != "Model" }.with(0, 255, 0)
private val espColor = ColorSettingsInteger(this, "ESPColor") {espMode != "Model" }.with(0, 255, 0)

val color
get() = espColor.color()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R, hideModule
private val circleRainbow by boolean("CircleRainbow", false, subjective = true) { mark == "Circle" }
private val colors = ColorSettingsInteger(
this,
"Circle"
"CircleColor"
) { mark == "Circle" && !circleRainbow }.with(132, 102, 255, 100)
private val fillInnerCircle by boolean("FillInnerCircle", false, subjective = true) { mark == "Circle" }
private val withHeight by boolean("WithHeight", true, subjective = true) { mark == "Circle" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ object FlagCheck : Module("FlagCheck", Category.MISC, gameDetecting = true, hide

private val colors = ColorSettingsInteger(
this,
"Text",
"TextColor",
applyMax = true
) { renderServerPos == "Box" }

private val boxColors = ColorSettingsInteger(
this,
"Box",
"BoxColor",
) { renderServerPos == "Box" }.with(r = 255, g = 255)

private val scale by float("Scale", 1F, 1F..6F) { renderServerPos == "Box" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ object BedPlates : Module("BedPlates", Category.RENDER, hideModule = false) {
private val maxLayers by int("MaxLayers", 5, 1..10)
private val scale by float("Scale", 3F, 1F..5F)

private val textMode by choices("Text-Color", arrayOf("Custom", "Rainbow", "Gradient"), "Custom")
private val textColors = ColorSettingsInteger(this, "Text", applyMax = true) { textMode == "Custom" }
private val textMode by choices("Text-ColorMode", arrayOf("Custom", "Rainbow", "Gradient"), "Custom")
private val textColors = ColorSettingsInteger(this, "TextColor", applyMax = true) { textMode == "Custom" }

private val gradientTextSpeed by float("Text-Gradient-Speed", 1f, 0.5f..10f) { textMode == "Gradient" }

Expand All @@ -76,8 +76,8 @@ object BedPlates : Module("BedPlates", Category.RENDER, hideModule = false) {

private val roundedRectRadius by float("Rounded-Radius", 3F, 0F..5F)

private val backgroundMode by choices("Background-Color", arrayOf("Custom", "Rainbow", "Gradient"), "Custom")
private val bgColors = ColorSettingsInteger(this, "Background") { backgroundMode == "Custom" }.with(a = 100)
private val backgroundMode by choices("Background-Mode", arrayOf("Custom", "Rainbow", "Gradient"), "Custom")
private val bgColors = ColorSettingsInteger(this, "BackgroundColor") { backgroundMode == "Custom" }.with(a = 100)

private val gradientBackgroundSpeed by float("Background-Gradient-Speed", 1f, 0.5f..10f)
{ backgroundMode == "Gradient" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object ChineseHat : Module("ChineseHat", Category.RENDER) {

private val useChineseHatTexture by boolean("UseChineseHatTexture", false)

private val colorMode by choices("Color", arrayOf("Custom", "DistanceColor"), "Custom")
private val colorMode by choices("ColorMode", arrayOf("Custom", "DistanceColor"), "Custom")
private val colors = ColorSettingsInteger(this) { colorMode == "Custom" }.with(0, 160, 255, 150)

private val playerHeight by float("PlayerHeight", 0.5f, 0.25f..2f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object ESP : Module("ESP", Category.RENDER, hideModule = false) {
private val glowFade by int("Glow-Fade", 10, 0..30) { mode == "Glow" }
private val glowTargetAlpha by float("Glow-Target-Alpha", 0f, 0f..1f) { mode == "Glow" }

private val espColor = ColorSettingsInteger(this, "ESP").with(255, 255, 255)
private val espColor = ColorSettingsInteger(this, "ESPColor").with(255, 255, 255)

private val maxRenderDistance by object : IntegerValue("MaxRenderDistance", 100, 1..200) {
override fun onUpdate(value: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import kotlin.math.sqrt
object Projectiles : Module("Projectiles", Category.RENDER, gameDetecting = false, hideModule = false) {
private val maxTrailSize by int("MaxTrailSize", 20, 1..100)

private val colorMode by choices("Color", arrayOf("Custom", "BowPower"), "Custom")
private val colorMode by choices("ColorMode", arrayOf("Custom", "BowPower"), "Custom")
private val color by color("Color", Color(0, 160, 255)) { colorMode == "Custom" }

private val trailPositions = mutableMapOf<Entity, ArrayDeque<ProjectilePos>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ object StorageESP : Module("StorageESP", Category.RENDER) {
private val glowFade by int("Glow-Fade", 10, 0..30) { mode == "Glow" }
private val glowTargetAlpha by float("Glow-Target-Alpha", 0f, 0f..1f) { mode == "Glow" }

private val espColorMode by choices("ESP-Color", arrayOf("None", "Custom"), "None")
private val espColor = ColorSettingsInteger(this, "ESP")
private val espColorMode by choices("ESP-ColorMode", arrayOf("None", "Custom"), "None")
private val espColor = ColorSettingsInteger(this, "ESPColor")
{ espColorMode == "Custom" }.with(255, 179, 72)

private val maxRenderDistance by object : IntegerValue("MaxRenderDistance", 100, 1..500) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import kotlin.math.pow

object Tracers : Module("Tracers", Category.RENDER, hideModule = false) {

private val colorMode by choices("Color", arrayOf("Custom", "DistanceColor"), "Custom")
private val colorMode by choices("ColorMode", arrayOf("Custom", "DistanceColor"), "Custom")
private val color by color("Color", Color(0, 160, 255, 150)) { colorMode == "Custom" }

private val thickness by float("Thickness", 2F, 1F..5F)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ object HUD : MinecraftInstance {
Radar::class.java,
SpeedGraph::class.java,
Cooldown::class.java,
BlockCounter::class.java,
Taco::class.java,
Keystrokes::class.java
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Arraylist(
) : Element(x, y, scale, side) {

private val textColorMode by choices(
"Text-Color", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom"
"Text-Mode", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom"
)
private val textColors = ColorSettingsInteger(this, "Text") { textColorMode == "Custom" }.with(0, 111, 255)
private val textColors = ColorSettingsInteger(this, "TextColor") { textColorMode == "Custom" }.with(0, 111, 255)
private val textFadeColors = ColorSettingsInteger(this, "Text-Fade") { textColorMode == "Fade" }.with(0, 111, 255)

private val textFadeDistance by int("Text-Fade-Distance", 50, 0..100) { textColorMode == "Fade" }
Expand All @@ -61,12 +61,12 @@ class Arraylist(
private val textGradColors =
ColorSettingsFloat.create(this, "Text-Gradient") { textColorMode == "Gradient" && it <= maxTextGradientColors }

private val rectMode by choices("Rect", arrayOf("None", "Left", "Right", "Outline"), "None")
private val rectMode by choices("Rect-Mode", arrayOf("None", "Left", "Right", "Outline"), "None")
private val roundedRectRadius by float("RoundedRect-Radius", 0F, 0F..2F) { rectMode !in setOf("None", "Outline") }
private val rectColorMode by choices(
"Rect-Color", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Rainbow"
"Rect-ColorMode", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Rainbow"
) { rectMode != "None" }
private val rectColors = ColorSettingsInteger(this, "Rect", applyMax = true) { isCustomRectSupported }
private val rectColors = ColorSettingsInteger(this, "RectColor", applyMax = true) { isCustomRectSupported }
private val rectFadeColors = ColorSettingsInteger(this, "Rect-Fade", applyMax = true) { rectColorMode == "Fade" }

private val rectFadeDistance by int("Rect-Fade-Distance", 50, 0..100) { rectColorMode == "Fade" }
Expand All @@ -83,9 +83,9 @@ class Arraylist(
private val roundedBackgroundRadius by float("RoundedBackGround-Radius", 0F, 0F..5F) { bgColors.color().alpha > 0 }

private val backgroundMode by choices(
"Background-Color", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom"
"Background-Mode", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom"
)
private val bgColors = ColorSettingsInteger(this, "Background") { backgroundMode == "Custom" }.with(a = 0)
private val bgColors = ColorSettingsInteger(this, "BackgroundColor") { backgroundMode == "Custom" }.with(a = 0)
private val bgFadeColors = ColorSettingsInteger(this, "Background-Fade") { backgroundMode == "Fade" }

private val bgFadeDistance by int("Background-Fade-Distance", 50, 0..100) { backgroundMode == "Fade" }
Expand Down Expand Up @@ -136,9 +136,7 @@ class Arraylist(
companion object {
val spacedModules by boolean("SpacedModules", false)
val inactiveStyle by choices(
"InactiveModulesStyle",
arrayOf("Normal", "Color", "Hide"),
"Color"
"InactiveModulesStyle", arrayOf("Normal", "Color", "Hide"), "Color"
) { GameDetector.state }
}

Expand Down Expand Up @@ -232,7 +230,7 @@ class Arraylist(
}
}
// Draw arraylist
val textCustomColor = textColors.color(1).rgb
val textCustomColor = textColors.color().rgb
val rectCustomColor = rectColors.color().rgb
val backgroundCustomColor = bgColors.color().rgb
val textSpacer = textHeight + space
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Radar(x: Double = 5.0, y: Double = 130.0) : Element(x, y) {

private val bgColor by color("BackgroundColor", Color.BLACK.withAlpha(50))

private val borderStrength by float("Border Strength", 2F, 1F..5F)
private val borderStrength by float("Border-Strength", 2F, 1F..5F)

private val rainbowX by float("Rainbow-X", -1000F, -2000F..2000F) { borderRainbow }
private val rainbowY by float("Rainbow-Y", -1000F, -2000F..2000F) { borderRainbow }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TabGUI(x: Double = 2.0, y: Double = 31.0) : Element(x = x, y = y) {
private val bgColor by color("BackgroundColor", Color.BLACK.withAlpha(150))

private val borderValue by boolean("Border", false)
private val borderStrength by float("Border Strength", 2F, 1F..5F) { borderValue }
private val borderStrength by float("Border-Strength", 2F, 1F..5F) { borderValue }

private val borderColor = color("BorderColor", Color.BLACK.withAlpha(150)) { borderValue }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class Target : Element() {

private val borderStrength by float("Border-Strength", 3F, 1F..5F)

private val backgroundMode by choices("Background-Color", arrayOf("Custom", "Rainbow"), "Custom")
private val backgroundColor by color("Background", Color.BLACK.withAlpha(150)) { backgroundMode == "Custom" }
private val backgroundMode by choices("Background-ColorMode", arrayOf("Custom", "Rainbow"), "Custom")
private val backgroundColor by color("Background-Color", Color.BLACK.withAlpha(150)) { backgroundMode == "Custom" }

private val borderMode by choices("Border-Color", arrayOf("Custom", "Rainbow"), "Custom")
private val borderColor by color("Border", Color.BLACK) { borderMode == "Custom" }
private val borderMode by choices("Border-ColorMode", arrayOf("Custom", "Rainbow"), "Custom")
private val borderColor by color("Border-Color", Color.BLACK) { borderMode == "Custom" }

private val textColor by color("Text", Color.WHITE)
private val textColor by color("TextColor", Color.WHITE)

private val rainbowX by float("Rainbow-X", -1000F, -2000F..2000F) { backgroundMode == "Rainbow" }
private val rainbowY by float("Rainbow-Y", -1000F, -2000F..2000F) { backgroundMode == "Rainbow" }
Expand Down Expand Up @@ -173,7 +173,7 @@ class Target : Element() {
).roundToInt()

val targetBorder = if (shouldRender) {
borderAlpha
borderColor.alpha
} else if (delayCounter >= vanishDelay) {
0f
} else alphaBorder
Expand Down
Loading

0 comments on commit af39852

Please sign in to comment.