diff --git a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt index babb1c4b800..912db73b8ba 100644 --- a/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt +++ b/src/main/java/net/ccbluex/liquidbounce/ui/client/hud/element/elements/Arraylist.kt @@ -67,7 +67,8 @@ class Arraylist( private val rectColorMode by choices( "Rect-ColorMode", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom" ) { rectMode != "None" } - private val rectColors = ColorSettingsInteger(this, "RectColor", applyMax = true) { isCustomRectSupported }.with(blueRibbon) + private val rectColors = + ColorSettingsInteger(this, "RectColor", applyMax = true) { isCustomRectSupported }.with(blueRibbon) private val rectFadeColors = ColorSettingsInteger(this, "Rect-Fade", applyMax = true) { rectColorMode == "Fade" } private val rectFadeDistance by int("Rect-Fade-Distance", 50, 0..100) { rectColorMode == "Fade" } @@ -86,7 +87,8 @@ class Arraylist( private val backgroundMode by choices( "Background-Mode", arrayOf("Custom", "Fade", "Random", "Rainbow", "Gradient"), "Custom" ) - private val bgColors = ColorSettingsInteger(this, "BackgroundColor") { backgroundMode == "Custom" }.with(Color.BLACK.withAlpha(150)) + private val bgColors = + ColorSettingsInteger(this, "BackgroundColor") { backgroundMode == "Custom" }.with(Color.BLACK.withAlpha(150)) private val bgFadeColors = ColorSettingsInteger(this, "Background-Fade") { backgroundMode == "Fade" } private val bgFadeDistance by int("Background-Fade-Distance", 50, 0..100) { backgroundMode == "Fade" } @@ -109,23 +111,12 @@ class Arraylist( private val yDistance by float("ShadowYDistance", 0F, -2F..2F) { iconShadows } private val shadowColor by color("ShadowColor", Color.BLACK.withAlpha(128), rainbow = true) { iconShadows } - // The images seem to be overlapped when either Rainbow or Gradient mode is active. private val iconColorMode by choices( - "IconColorMode", arrayOf("Custom", "Fade"/*, "Rainbow", "Gradient"*/), "Custom" + "IconColorMode", arrayOf("Custom", "Fade"), "Custom" ) { displayIcons } private val iconColor by color("IconColor", Color.WHITE) { iconColorMode == "Custom" && displayIcons } private val iconFadeColor by color("IconFadeColor", Color.WHITE) { iconColorMode == "Fade" && displayIcons } private val iconFadeDistance by int("IconFadeDistance", 50, 0..100) { iconColorMode == "Fade" && displayIcons } - /*private val maxIconGradientColors by int( - "MaxIconGradientColors", 4, 1..MAX_GRADIENT_COLORS - ) { iconColorMode == "Gradient" && displayIcons } - private val iconGradientSpeed by float( - "IconGradientSpeed", - 1f, - 0f..10f - ) { iconColorMode == "Gradient" && displayIcons } - private val iconGradColors = - ColorSettingsFloat.create(this, "Icon-Gradient") { iconColorMode == "Gradient" && displayIcons }*/ private fun isColorModeUsed(value: String) = value in listOf(textColorMode, rectMode, backgroundMode, iconColorMode) @@ -318,7 +309,11 @@ class Arraylist( else -> backgroundCustomColor }, roundedBackgroundRadius, - RenderUtils.RoundedCorners.LEFT_ONLY + if (rectMode == "Left") { + RenderUtils.RoundedCorners.NONE + } else { + RenderUtils.RoundedCorners.LEFT_ONLY + } ) } } @@ -374,7 +369,13 @@ class Arraylist( when (rectMode) { "Left" -> drawRoundedRect( - xPos - 5, yPos, xPos - 2, yPos + textSpacer, rectColor, roundedRectRadius, + xPos - 5, + yPos, + xPos - 2, + yPos + textSpacer, + rectColor, + roundedRectRadius, + RenderUtils.RoundedCorners.LEFT_ONLY ) "Right" -> drawRoundedRect( @@ -384,6 +385,13 @@ class Arraylist( yPos + textSpacer, rectColor, roundedRectRadius, + if (modules.lastIndex == 0) { + RenderUtils.RoundedCorners.RIGHT_ONLY + } else when (module) { + modules.first() -> RenderUtils.RoundedCorners.TOP_RIGHT_ONLY + modules.last() -> RenderUtils.RoundedCorners.BOTTOM_RIGHT_ONLY + else -> RenderUtils.RoundedCorners.NONE + } ) "Outline" -> { @@ -428,7 +436,7 @@ class Arraylist( ).use { RainbowShader.begin(backgroundMode == "Rainbow", rainbowX, rainbowY, rainbowOffset).use { drawRoundedRect( - 0F, + if (rectMode == "Left") 1f else 0f, yPos, xPos + width + if (rectMode == "Right") 4 else 1, yPos + textSpacer, @@ -440,7 +448,11 @@ class Arraylist( else -> backgroundCustomColor }, roundedBackgroundRadius, - RenderUtils.RoundedCorners.RIGHT_ONLY + if (rectMode == "Right") { + RenderUtils.RoundedCorners.NONE + } else { + RenderUtils.RoundedCorners.RIGHT_ONLY + } ) } } @@ -493,12 +505,18 @@ class Arraylist( when (rectMode) { "Left" -> drawRoundedRect( 0F, - yPos - 1, + yPos, 3F, yPos + textSpacer, rectColor, roundedRectRadius, - RenderUtils.RoundedCorners.RIGHT_ONLY + if (modules.lastIndex == 0) { + RenderUtils.RoundedCorners.LEFT_ONLY + } else when (module) { + modules.first() -> RenderUtils.RoundedCorners.TOP_LEFT_ONLY + modules.last() -> RenderUtils.RoundedCorners.BOTTOM_LEFT_ONLY + else -> RenderUtils.RoundedCorners.NONE + } ) "Right" -> drawRoundedRect(