diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-02-06 11:06:39 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-02-06 11:06:39 +0700 |
commit | eef8bab78435d86107d95951cc1da04317520d33 (patch) | |
tree | 2895150c05bd9d4db5ae4c406616260f3957c51b | |
parent | 6ef0b0b64522ae45bf3747b26bd6dc5f58358f82 (diff) | |
download | Chatting-eef8bab78435d86107d95951cc1da04317520d33.tar.gz Chatting-eef8bab78435d86107d95951cc1da04317520d33.tar.bz2 Chatting-eef8bab78435d86107d95951cc1da04317520d33.zip |
compact input box
-rw-r--r-- | src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java | 5 | ||||
-rw-r--r-- | src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java index b39950b..e3edf95 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java @@ -89,6 +89,11 @@ 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; + } + @Inject(method = "mouseClicked", at = @At("HEAD")) private void mouseClicked(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) { GuiNewChatHook hook = ((GuiNewChatHook) Minecraft.getMinecraft().ingameGUI.getChatGUI()); diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt index ec27a4e..67db660 100644 --- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt +++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt @@ -52,6 +52,14 @@ object ChattingConfig : Vigilant(File(Chatting.modDir, "${Chatting.ID}.toml"), C @Property( type = PropertyType.SWITCH, + name = "Compact Input Box", + description = "Make the width of the input box the same size as the chat box.", + category = "General" + ) + var compactInputBox = false + + @Property( + type = PropertyType.SWITCH, name = "Inform for Alternatives", description = "Inform the user if a mod they are using can be replaced by a feature in Chatting.", category = "General" |