aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
diff options
context:
space:
mode:
authorWyvest <wyvestbusiness@gmail.com>2023-11-22 08:18:19 +0900
committerWyvest <wyvestbusiness@gmail.com>2023-11-22 08:18:19 +0900
commit8b373f577d9c6dde26357ef3fc86691f1efef9b4 (patch)
treea5328e995d8f4df21a9fe94ac8e384be08833c70 /src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
parent64230799777473246b5f98efbc596206c5bbf42d (diff)
downloadChatting-8b373f577d9c6dde26357ef3fc86691f1efef9b4.tar.gz
Chatting-8b373f577d9c6dde26357ef3fc86691f1efef9b4.tar.bz2
Chatting-8b373f577d9c6dde26357ef3fc86691f1efef9b4.zip
update PGT and relocate to org.polyfrost
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.kt46
1 files changed, 0 insertions, 46 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
deleted file mode 100644
index e3b96f1..0000000
--- a/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-package cc.woverflow.chatting.gui.components
-
-import cc.polyfrost.oneconfig.libs.universal.UKeyboard
-import cc.polyfrost.oneconfig.libs.universal.UResolution
-import cc.woverflow.chatting.chat.ChatTab
-import cc.woverflow.chatting.chat.ChatTabs
-import cc.woverflow.chatting.config.ChattingConfig
-
-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] }, { 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() {
- if (UKeyboard.isShiftKeyDown()) {
- if (ChatTabs.currentTabs.contains(chatTab)) {
- ChatTabs.currentTabs.remove(chatTab)
- } else {
- ChatTabs.currentTabs.add(chatTab)
- }
- } else {
- ChatTabs.currentTabs.clear()
- ChatTabs.currentTabs.add(chatTab)
- }
- }
-
- override fun isEnabled(): Boolean {
- return ChatTabs.currentTabs.contains(chatTab)
- }
-
- companion object {
- const val color: Int = 14737632
- const val hoveredColor: Int = 16777120
- const val selectedColor: Int = 10526880
- }
-} \ No newline at end of file