Skip to content

Commit 2ceb289

Browse files
committed
Fix Navigator Bug
1 parent 5737149 commit 2ceb289

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

src/main/java/net/wurstclient/clickgui/components/SettingGroupComponent.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ public SettingGroupComponent(SettingGroup group, boolean allowPopout)
4242
expanded = group.isDefaultExpanded();
4343
rebuildChildren();
4444
setWidth(getDefaultWidth());
45-
setHeight(getDefaultHeight());
45+
// Height is already set by rebuildChildren() -> updateHeight().
46+
// Only override to default height when collapsed to ensure correct
47+
// initial sizing.
48+
if(!expanded)
49+
setHeight(getDefaultHeight());
4650
}
4751

4852
private void rebuildChildren()

src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
2929
import net.minecraft.sounds.SoundEvents;
3030
import net.minecraft.util.CommonColors;
31-
import net.minecraft.util.Mth;
3231
import net.wurstclient.Feature;
3332
import net.wurstclient.WurstClient;
3433
import net.wurstclient.clickgui.ClickGui;
@@ -470,10 +469,11 @@ protected void onRender(GuiGraphics context, int mouseX, int mouseY,
470469
int windowY1 = bgy1 + scroll + windowComponentY;
471470
int windowY2 = windowY1 + window.getInnerHeight();
472471

473-
context.fill(bgx1, bgy1, bgx2, Mth.clamp(windowY1, bgy1, bgy3),
474-
getBackgroundColor());
475-
context.fill(bgx1, Mth.clamp(windowY2, bgy1, bgy3), bgx2, bgy2,
476-
getBackgroundColor());
472+
// Fill the entire panel area with background color so that
473+
// all sections — settings, keybinds, text, and any empty
474+
// padding — get a consistent opaque background instead of
475+
// showing the world through gaps.
476+
context.fill(bgx1, bgy1, bgx2, bgy2, getBackgroundColor());
477477
RenderUtils.drawBoxShadow2D(context, bgx1, bgy1, bgx2, bgy2);
478478

479479
context.enableScissor(bgx1, bgy1, bgx2, bgy3);

src/main/java/net/wurstclient/navigator/NavigatorScreen.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ public final void render(GuiGraphics context, int mouseX, int mouseY,
203203
public void renderBackground(GuiGraphics context, int mouseX, int mouseY,
204204
float deltaTicks)
205205
{
206-
// Don't blur
206+
// Render a dark overlay so the Minecraft world does not show through
207+
// the semi-transparent areas of the Navigator GUI.
208+
context.fillGradient(0, 0, width, height, 0xDA10131B, 0xE0121B29);
207209
}
208210

209211
@Override
@@ -284,7 +286,10 @@ protected final int getBackgroundColor()
284286
{
285287
ClickGui gui = WurstClient.INSTANCE.getGui();
286288
gui.updateColors();
287-
return RenderUtils.toIntColor(gui.getBgColor(), gui.getOpacity());
289+
// Ensure a minimum opacity so panel backgrounds are always opaque
290+
// enough to hide the world behind the GUI.
291+
return RenderUtils.toIntColor(gui.getBgColor(),
292+
Math.max(0.85F, gui.getOpacity()));
288293
}
289294

290295
protected final void drawBackgroundBox(GuiGraphics context, int x1, int y1,

0 commit comments

Comments
 (0)