aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-02-06 11:06:39 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-02-06 11:06:39 +0700
commiteef8bab78435d86107d95951cc1da04317520d33 (patch)
tree2895150c05bd9d4db5ae4c406616260f3957c51b /src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java
parent6ef0b0b64522ae45bf3747b26bd6dc5f58358f82 (diff)
downloadChatting-eef8bab78435d86107d95951cc1da04317520d33.tar.gz
Chatting-eef8bab78435d86107d95951cc1da04317520d33.tar.bz2
Chatting-eef8bab78435d86107d95951cc1da04317520d33.zip
compact input box
Diffstat (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java5
1 files changed, 5 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());