aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-03-12 15:43:15 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-03-12 15:43:15 +0700
commiteece3cb994280498d2a9c259030cc79a4be3fce3 (patch)
treee23c8d6a1c2553d2511630012f275ffa15ebf532 /src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
parent380e0adb5ef1401dd8cbf70b2ef7bc121c371c42 (diff)
downloadChatting-eece3cb994280498d2a9c259030cc79a4be3fce3.tar.gz
Chatting-eece3cb994280498d2a9c259030cc79a4be3fce3.tar.bz2
Chatting-eece3cb994280498d2a9c259030cc79a4be3fce3.zip
color property
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
index 25190e1..da20eed 100644
--- a/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
@@ -8,7 +8,17 @@ import gg.essential.universal.UResolution
class TabButton(buttonId: Int, x: Int, widthIn: Int, heightIn: Int, private val chatTab: ChatTab) :
CleanButton(buttonId, { x }, {
UResolution.scaledHeight - 26
- }, widthIn, heightIn, chatTab.name, { RenderType.values()[ChattingConfig.textRenderType] }) {
+ }, widthIn, heightIn, chatTab.name, { RenderType.values()[ChattingConfig.textRenderType] }, { packedFGColour: Int, enabled: Boolean, hovered: Boolean ->
+ var j = chatTab.color ?: color
+ if (packedFGColour != 0) {
+ j = packedFGColour
+ } else if (!enabled) {
+ j = chatTab.selectedColor ?: selectedColor
+ } else if (hovered) {
+ j = chatTab.hoveredColor ?: hoveredColor
+ }
+ j
+ }) {
override fun onMousePress() {
ChatTabs.currentTab = chatTab
@@ -17,4 +27,10 @@ class TabButton(buttonId: Int, x: Int, widthIn: Int, heightIn: Int, private val
override fun isEnabled(): Boolean {
return chatTab != ChatTabs.currentTab
}
+
+ companion object {
+ const val color: Int = 14737632
+ const val hoveredColor: Int = 16777120
+ const val selectedColor: Int = 10526880
+ }
} \ No newline at end of file