Skip to content

Commit d89f0ff

Browse files
committed
ClientChatOverlay
1 parent 61dfa54 commit d89f0ff

10 files changed

Lines changed: 809 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,13 @@ This hack is still undergoing development and has only been tested in the end. A
797797

798798
![ChunkyDunky](https://i.imgur.com/ndNfFUD.png)
799799

800+
### ClientChatOverlay
801+
- Adds a separate chat overlay that captures non-player/client/mod outputs and keeps normal player chat in the bottom vanilla chat
802+
- Optional transparancy, fade-out time, route to game console, Wurst only mode, max lines and X/Y offset
803+
- Can adjust its position by moving it with mouse when in inventory or container
804+
- Auto avoids vanilla chat messages if positioned above it
805+
- Is scrollable when chat is opened
806+
800807
## What's changed or improved in this fork?
801808

802809
### ChestESP

src/main/java/net/wurstclient/clickgui/ClickGui.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ public void init()
132132

133133
if(f.getCategory() != null)
134134
{
135-
// GameStats is intentionally shown only in the dedicated
136-
// "UI Settings" window, not in category windows.
137-
if(f == WURST.getHax().gameStatsHack)
135+
// Some HUD/UI hacks are intentionally shown only in the
136+
// dedicated "UI Settings" window, not in category windows.
137+
if(f == WURST.getHax().gameStatsHack
138+
|| f == WURST.getHax().clientChatOverlayHack)
138139
continue;
139140

140141
windowMap.get(f.getCategory()).add(new FeatureButton(f));
@@ -175,6 +176,7 @@ public void init()
175176
uiSettings.add(new FeatureButton(WURST.getOtfs().wurstLogoOtf));
176177
uiSettings.add(new FeatureButton(WURST.getOtfs().hackListOtf));
177178
uiSettings.add(new FeatureButton(WURST.getHax().gameStatsHack));
179+
uiSettings.add(new FeatureButton(WURST.getHax().clientChatOverlayHack));
178180
uiSettings.add(new FeatureButton(WURST.getOtfs().keybindManagerOtf));
179181
uiSettings.add(new FeatureButton(WURST.getOtfs().presetManagerOtf));
180182
uiSettings.add(new FeatureButton(WURST.getOtfs().wurstOptionsOtf));

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public final class HackList implements UpdateListener
141141
public final HideWurstHack hideWurstHack = new HideWurstHack();
142142
public final DurabilityHudHack durabilityHudHack = new DurabilityHudHack();
143143
public final GameStatsHack gameStatsHack = new GameStatsHack();
144+
public final ClientChatOverlayHack clientChatOverlayHack =
145+
new ClientChatOverlayHack();
144146
public final HighJumpHack highJumpHack = new HighJumpHack();
145147
public final InfiniChatHack infiniChatHack = new InfiniChatHack();
146148
public final InstaBuildHack instaBuildHack = new InstaBuildHack();
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/*
2+
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.hacks;
9+
10+
import java.util.Arrays;
11+
import java.util.LinkedHashSet;
12+
import java.util.Set;
13+
import java.util.stream.Collectors;
14+
15+
import net.wurstclient.Category;
16+
import net.wurstclient.SearchTags;
17+
import net.wurstclient.hack.Hack;
18+
import net.wurstclient.settings.CheckboxSetting;
19+
import net.wurstclient.settings.SliderSetting;
20+
import net.wurstclient.settings.TextFieldSetting;
21+
import net.wurstclient.settings.SliderSetting.ValueDisplay;
22+
23+
@SearchTags({"ui settings", "chat overlay", "hud", "client chat"})
24+
public final class ClientChatOverlayHack extends Hack
25+
{
26+
private final SliderSetting transparency =
27+
new SliderSetting("Transparency", 35, 0, 100, 1, ValueDisplay.INTEGER);
28+
private final SliderSetting fadeOutTimeSeconds =
29+
new SliderSetting("Fade-out time", 10, 1, 60, 1, ValueDisplay.INTEGER);
30+
private final CheckboxSetting routeToConsole =
31+
new CheckboxSetting("Route to game console", false);
32+
private final CheckboxSetting onlyWurstMessages =
33+
new CheckboxSetting("Only Wurst messages", false);
34+
private final TextFieldSetting forceClientKeywords = new TextFieldSetting(
35+
"Force client chat keywords",
36+
"Comma-separated keywords that force a message into client chat.", "");
37+
private final TextFieldSetting forceNormalKeywords = new TextFieldSetting(
38+
"Force normal chat keywords",
39+
"Comma-separated keywords that force a message into normal chat.", "");
40+
private final SliderSetting maxLines =
41+
new SliderSetting("Max lines", 10, 3, 30, 1, ValueDisplay.INTEGER);
42+
private final SliderSetting hudOffsetX = new SliderSetting("HUD X offset",
43+
0, -320, 320, 1, ValueDisplay.INTEGER);
44+
private final SliderSetting hudOffsetY = new SliderSetting("HUD Y offset",
45+
0, -240, 240, 1, ValueDisplay.INTEGER);
46+
47+
public ClientChatOverlayHack()
48+
{
49+
super("ClientChatOverlay");
50+
setCategory(Category.OTHER);
51+
addSetting(transparency);
52+
addSetting(fadeOutTimeSeconds);
53+
addSetting(routeToConsole);
54+
addSetting(onlyWurstMessages);
55+
addSetting(forceClientKeywords);
56+
addSetting(forceNormalKeywords);
57+
addSetting(maxLines);
58+
addSetting(hudOffsetX);
59+
addSetting(hudOffsetY);
60+
}
61+
62+
public int getTransparencyPercent()
63+
{
64+
return transparency.getValueI();
65+
}
66+
67+
public long getFadeOutTimeMs()
68+
{
69+
return fadeOutTimeSeconds.getValueI() * 1000L;
70+
}
71+
72+
public boolean isRoutingToConsole()
73+
{
74+
return routeToConsole.isChecked();
75+
}
76+
77+
public boolean isOnlyWurstMessages()
78+
{
79+
return onlyWurstMessages.isChecked();
80+
}
81+
82+
public boolean matchesForceClientKeyword(String text)
83+
{
84+
return matchesAnyKeyword(text, getForceClientKeywords());
85+
}
86+
87+
public boolean matchesForceNormalKeyword(String text)
88+
{
89+
return matchesAnyKeyword(text, getForceNormalKeywords());
90+
}
91+
92+
public int getMaxLines()
93+
{
94+
return maxLines.getValueI();
95+
}
96+
97+
public int getHudOffsetX()
98+
{
99+
return hudOffsetX.getValueI();
100+
}
101+
102+
public int getHudOffsetY()
103+
{
104+
return hudOffsetY.getValueI();
105+
}
106+
107+
public void setHudOffsets(int x, int y)
108+
{
109+
hudOffsetX.setValue(x);
110+
hudOffsetY.setValue(y);
111+
}
112+
113+
private Set<String> getForceClientKeywords()
114+
{
115+
return parseKeywords(forceClientKeywords.getValue());
116+
}
117+
118+
private Set<String> getForceNormalKeywords()
119+
{
120+
return parseKeywords(forceNormalKeywords.getValue());
121+
}
122+
123+
private static Set<String> parseKeywords(String value)
124+
{
125+
if(value == null || value.isBlank())
126+
return Set.of();
127+
128+
return Arrays.stream(value.split(",")).map(String::trim)
129+
.filter(s -> !s.isEmpty()).map(String::toLowerCase)
130+
.collect(Collectors.toCollection(LinkedHashSet::new));
131+
}
132+
133+
private static boolean matchesAnyKeyword(String text, Set<String> keywords)
134+
{
135+
if(text == null || text.isBlank() || keywords.isEmpty())
136+
return false;
137+
138+
String lower = text.toLowerCase();
139+
for(String keyword : keywords)
140+
if(lower.contains(keyword))
141+
return true;
142+
143+
return false;
144+
}
145+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ public void onReceivedMessage(ChatInputEvent event)
570570
@Override
571571
public void onUpdate()
572572
{
573+
if(!isEnabled())
574+
{
575+
connectionPreviouslyNull = MC.getConnection() == null;
576+
return;
577+
}
578+
573579
boolean connected = MC.getConnection() != null;
574580
if(connected && connectionPreviouslyNull)
575581
{

0 commit comments

Comments
 (0)