From eef8bab78435d86107d95951cc1da04317520d33 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sun, 6 Feb 2022 11:06:39 +0700 Subject: compact input box --- src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java') 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()); -- cgit