diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt index 2fe2e9f..de590e6 100644 --- a/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt +++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt @@ -32,7 +32,7 @@ open class CleanButton( j = 16777120 } j - } + }, ) : GuiButton(buttonId, x.invoke(), 0, widthIn, heightIn, name) { @@ -68,7 +68,7 @@ open class CleanButton( yPosition, xPosition + width, yPosition + height, - (if (hovered) ChattingConfig.chatButtonHoveredBackgroundColor else ChattingConfig.chatButtonBackgroundColor).rgb + getBackgroundColor(hovered) ) } mouseDragged(mc, mouseX, mouseY) @@ -97,6 +97,7 @@ open class CleanButton( } } - companion object { - } + private fun getBackgroundColor(hovered: Boolean) = + if (hovered) ChattingConfig.chatButtonHoveredBackgroundColor.rgb + else ChattingConfig.chatButtonBackgroundColor.rgb } \ No newline at end of file