Skip to content

Commit 274a886

Browse files
committed
Fix Navigator Bug
1 parent 7eed458 commit 274a886

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;
@@ -471,10 +470,11 @@ protected void onRender(GuiGraphicsExtractor context, int mouseX,
471470
int windowY1 = bgy1 + scroll + windowComponentY;
472471
int windowY2 = windowY1 + window.getInnerHeight();
473472

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

480480
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
@@ -205,7 +205,9 @@ public final void extractRenderState(GuiGraphicsExtractor context,
205205
public void extractBackground(GuiGraphicsExtractor context, int mouseX,
206206
int mouseY, float deltaTicks)
207207
{
208-
// Don't blur
208+
// Render a dark overlay so the Minecraft world does not show through
209+
// the semi-transparent areas of the Navigator GUI.
210+
context.fillGradient(0, 0, width, height, 0xDA10131B, 0xE0121B29);
209211
}
210212

211213
@Override
@@ -286,7 +288,10 @@ protected final int getBackgroundColor()
286288
{
287289
ClickGui gui = WurstClient.INSTANCE.getGui();
288290
gui.updateColors();
289-
return RenderUtils.toIntColor(gui.getBgColor(), gui.getOpacity());
291+
// Ensure a minimum opacity so panel backgrounds are always opaque
292+
// enough to hide the world behind the GUI.
293+
return RenderUtils.toIntColor(gui.getBgColor(),
294+
Math.max(0.85F, gui.getOpacity()));
290295
}
291296

292297
protected final void drawBackgroundBox(GuiGraphicsExtractor context, int x1,

0 commit comments

Comments
 (0)