aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/gui
diff options
context:
space:
mode:
authorRedth <redth1206@proton.me>2023-11-07 21:18:28 +0800
committerRedth <redth1206@proton.me>2023-11-07 21:18:28 +0800
commit3b50dd70f1fb7fb855fab39fa959002652db225b (patch)
tree7f7730de8c9791cb22aa8df40eb127ba5d63beb5 /src/main/kotlin/cc/woverflow/chatting/gui
parentc7eda89469f6f51524c84af9dfb189350b86a00f (diff)
downloadChatting-3b50dd70f1fb7fb855fab39fa959002652db225b.tar.gz
Chatting-3b50dd70f1fb7fb855fab39fa959002652db225b.tar.bz2
Chatting-3b50dd70f1fb7fb855fab39fa959002652db225b.zip
( not good
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/gui')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt9
1 files changed, 5 insertions, 4 deletions
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