Skip to content

Commit eef8bab

Browse files
committed
compact input box
1 parent 6ef0b0b commit eef8bab

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ private void onDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackIn
8989
}
9090
}
9191

92+
@ModifyArg(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;drawRect(IIIII)V"), index = 2)
93+
private int modifyRight(int right) {
94+
return ChattingConfig.INSTANCE.getCompactInputBox() ? (MathHelper.ceiling_float_int((float)mc.ingameGUI.getChatGUI().getChatWidth() / mc.ingameGUI.getChatGUI().getChatScale()) + 6) : right;
95+
}
96+
9297
@Inject(method = "mouseClicked", at = @At("HEAD"))
9398
private void mouseClicked(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) {
9499
GuiNewChatHook hook = ((GuiNewChatHook) Minecraft.getMinecraft().ingameGUI.getChatGUI());

src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ object ChattingConfig : Vigilant(File(Chatting.modDir, "${Chatting.ID}.toml"), C
5050
)
5151
var chatBackgroundColor = Color(0, 0, 0, 50)
5252

53+
@Property(
54+
type = PropertyType.SWITCH,
55+
name = "Compact Input Box",
56+
description = "Make the width of the input box the same size as the chat box.",
57+
category = "General"
58+
)
59+
var compactInputBox = false
60+
5361
@Property(
5462
type = PropertyType.SWITCH,
5563
name = "Inform for Alternatives",

0 commit comments

Comments
 (0)