Skip to content

Commit eb6d3f4

Browse files
committed
Updated ClientChatOverlay
1 parent 791cdfa commit eb6d3f4

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ Purpose: helps you avoid and debug anticheat flags by cleaning risky movement pa
830830
- Can adjust its position by moving it with mouse when in inventory or container
831831
- Auto avoids vanilla chat messages if positioned above it
832832
- Is scrollable when chat is opened
833+
- Able to adjust font size of chat
833834

834835
### AutoChat
835836
- AutoChat watches incoming chat and keeps a rolling context history (configurable size).

src/main/java/net/wurstclient/hacks/ClientChatOverlayHack.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public final class ClientChatOverlayHack extends Hack
3939
"Comma-separated keywords that force a message into normal chat.", "");
4040
private final SliderSetting maxLines =
4141
new SliderSetting("Max lines", 10, 3, 30, 1, ValueDisplay.INTEGER);
42+
private final SliderSetting chatFontScale =
43+
new SliderSetting("Chat font size",
44+
"description.wurst.setting.clientchatoverlay.chat_font_scale", 1,
45+
0.5, 2, 0.05, ValueDisplay.DECIMAL.withSuffix("x"));
4246
private final SliderSetting hudOffsetX = new SliderSetting("HUD X offset",
4347
0, -320, 320, 1, ValueDisplay.INTEGER);
4448
private final SliderSetting hudOffsetY = new SliderSetting("HUD Y offset",
@@ -55,6 +59,7 @@ public ClientChatOverlayHack()
5559
addSetting(forceClientKeywords);
5660
addSetting(forceNormalKeywords);
5761
addSetting(maxLines);
62+
addSetting(chatFontScale);
5863
addSetting(hudOffsetX);
5964
addSetting(hudOffsetY);
6065
}
@@ -94,6 +99,11 @@ public int getMaxLines()
9499
return maxLines.getValueI();
95100
}
96101

102+
public double getChatFontScale()
103+
{
104+
return chatFontScale.getValue();
105+
}
106+
97107
public int getHudOffsetX()
98108
{
99109
return hudOffsetX.getValueI();

src/main/java/net/wurstclient/mixin/SimpleOptionMixin.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
import org.spongepowered.asm.mixin.Final;
1414
import org.spongepowered.asm.mixin.Mixin;
1515
import org.spongepowered.asm.mixin.Shadow;
16+
import org.spongepowered.asm.mixin.injection.At;
17+
import org.spongepowered.asm.mixin.injection.Inject;
18+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1619
import net.minecraft.client.Minecraft;
1720
import net.minecraft.client.OptionInstance;
21+
import net.wurstclient.WurstClient;
1822
import net.wurstclient.mixinterface.ISimpleOption;
1923

2024
@Mixin(OptionInstance.class)
@@ -42,4 +46,36 @@ public void forceSetValue(T newValue)
4246
onValueUpdate.accept(value);
4347
}
4448
}
49+
50+
@SuppressWarnings("unchecked")
51+
@Inject(method = "get", at = @At("RETURN"), cancellable = true, require = 0)
52+
private void wurst$applyChatFontScale(CallbackInfoReturnable<T> cir)
53+
{
54+
T value = cir.getReturnValue();
55+
if(!(value instanceof Double d))
56+
return;
57+
58+
Minecraft mc = Minecraft.getInstance();
59+
if(mc == null || mc.options == null
60+
|| (Object)this != mc.options.chatScale())
61+
return;
62+
63+
double chatFontScale = 1;
64+
try
65+
{
66+
WurstClient wurst = WurstClient.INSTANCE;
67+
if(wurst != null && wurst.getHax() != null)
68+
chatFontScale =
69+
wurst.getHax().clientChatOverlayHack.getChatFontScale();
70+
71+
}catch(RuntimeException ignored)
72+
{
73+
return;
74+
}
75+
76+
if(Math.abs(chatFontScale - 1) < 1e-6)
77+
return;
78+
79+
cir.setReturnValue((T)Double.valueOf(d * chatFontScale));
80+
}
4581
}

src/main/resources/assets/wurst/translations/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"hack.wurst.clientchatoverlay": "Client Chat Overlay",
9494
"description.wurst.hack.gamestats": "Shows customizable game/session stats on your HUD, including FPS/TPS/Ping, play time, time, packet rate, distance, kills, and XP gained.",
9595
"description.wurst.hack.clientchatoverlay": "Splits client/mod/system messages into a separate overlay above chat. Supports drag-to-move, scroll-on-hover, fade-out timing, transparency, optional routing to the game console, and Wurst-only filtering.",
96+
"description.wurst.setting.clientchatoverlay.chat_font_scale": "Extra multiplier for in-game chat text size. Affects vanilla chat and Client Chat Overlay.",
9697
"description.wurst.hack.chorusfruit": "Consumes a chorus fruit item when the selected trigger happens and your health is low.",
9798
"hack.wurst.livestreamdetector": "LivestreamDetector",
9899
"description.wurst.hack.livestreamdetector": "Scans the tab list for live streamers on YouTube, Twitch, TikTok, and Kick and announces streams in chat.",

0 commit comments

Comments
 (0)