aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRedth <redth1206@proton.me>2023-11-07 20:01:24 +0800
committerRedth <redth1206@proton.me>2023-11-07 20:01:24 +0800
commitc7eda89469f6f51524c84af9dfb189350b86a00f (patch)
tree35151ba50ea0fe0533f5902f80f9530634608d3d /src
parentcd25a22ebade375a5be4000c04743ba738f9b71f (diff)
downloadChatting-c7eda89469f6f51524c84af9dfb189350b86a00f.tar.gz
Chatting-c7eda89469f6f51524c84af9dfb189350b86a00f.tar.bz2
Chatting-c7eda89469f6f51524c84af9dfb189350b86a00f.zip
chat button background colors
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt12
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt6
2 files changed, 14 insertions, 4 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
index e17eb0c..711250f 100644
--- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
@@ -62,6 +62,18 @@ object ChattingConfig : Config(
)
var inputBoxBackgroundColor = OneColor(0, 0, 0, 128)
+ @Color(
+ name = "Chat Button Background Color", category = "General",
+ description = "The color of the chat button background."
+ )
+ var chatButtonBackgroundColor = OneColor(0, 0, 0, 128)
+
+ @Color(
+ name = "Chat Button Hovered Background Color", category = "General",
+ description = "The color of the chat button background when hovered."
+ )
+ var chatButtonHoveredBackgroundColor = OneColor(255, 255, 255, 128)
+
@Switch(
name = "Inform Outdated Mods", category = "General",
description = "Inform the user when a mod can be replaced by Chatting."
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 8bc05bb..2fe2e9f 100644
--- a/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt
@@ -2,12 +2,12 @@ package cc.woverflow.chatting.gui.components
import cc.polyfrost.oneconfig.renderer.TextRenderer
import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.config.ChattingConfig
import cc.woverflow.chatting.hook.GuiNewChatHook
import club.sk1er.patcher.config.PatcherConfig
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.renderer.GlStateManager
-import java.awt.Color
/**
* Taken from ChatShortcuts under MIT License
@@ -68,7 +68,7 @@ open class CleanButton(
yPosition,
xPosition + width,
yPosition + height,
- if (hovered) hoveredColor else color
+ (if (hovered) ChattingConfig.chatButtonHoveredBackgroundColor else ChattingConfig.chatButtonBackgroundColor).rgb
)
}
mouseDragged(mc, mouseX, mouseY)
@@ -98,7 +98,5 @@ open class CleanButton(
}
companion object {
- val hoveredColor = Color(255, 255, 255, 128).rgb
- val color = Color(0, 0, 0, 128).rgb
}
} \ No newline at end of file