aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRedth <redth1206@proton.me>2023-10-27 22:51:34 +0800
committerRedth <redth1206@proton.me>2023-10-27 22:51:34 +0800
commitcd25a22ebade375a5be4000c04743ba738f9b71f (patch)
treeadbe53e48c1e8ac681db5522d4cb1a4c1ed6aba9 /src
parent08aa76c496a6be564bbe68c367134745c187fdfc (diff)
downloadChatting-cd25a22ebade375a5be4000c04743ba738f9b71f.tar.gz
Chatting-cd25a22ebade375a5be4000c04743ba738f9b71f.tar.bz2
Chatting-cd25a22ebade375a5be4000c04743ba738f9b71f.zip
input box color
Diffstat (limited to 'src')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java7
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt6
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java
index cc015ab..a12aea1 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java
@@ -92,7 +92,12 @@ public abstract class GuiChatMixin extends GuiScreen {
@ModifyArg(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;drawRect(IIIII)V"), index = 2)
private int modifyRight(int right) {
- return ChattingConfig.INSTANCE.getCompactInputBox() ? (MathHelper.ceiling_float_int((float)mc.ingameGUI.getChatGUI().getChatWidth() / mc.ingameGUI.getChatGUI().getChatScale()) + 6) : right;
+ return ChattingConfig.INSTANCE.getCompactInputBox() ? (MathHelper.ceiling_float_int((float) mc.ingameGUI.getChatGUI().getChatWidth() / mc.ingameGUI.getChatGUI().getChatScale()) + 6) : right;
+ }
+
+ @ModifyArg(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;drawRect(IIIII)V"), index = 4)
+ private int modifyInputBoxColor(int color) {
+ return ChattingConfig.INSTANCE.getInputBoxBackgroundColor().getRGB();
}
@Inject(method = "mouseClicked", at = @At("HEAD"))
diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
index 71f7f02..e17eb0c 100644
--- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
@@ -56,6 +56,12 @@ object ChattingConfig : Config(
)
var compactInputBox = false
+ @Color(
+ name = "Input Box Background Color", category = "General",
+ description = "The color of the chat input box background."
+ )
+ var inputBoxBackgroundColor = OneColor(0, 0, 0, 128)
+
@Switch(
name = "Inform Outdated Mods", category = "General",
description = "Inform the user when a mod can be replaced by Chatting."