From 3b50dd70f1fb7fb855fab39fa959002652db225b Mon Sep 17 00:00:00 2001 From: Redth Date: Tue, 7 Nov 2023 21:18:28 +0800 Subject: ( not good --- .../kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/kotlin/cc') 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 -- cgit