Fix computer sidebar buttons being invisible

This commit is contained in:
Jonathan Coates 2023-08-27 19:25:04 +01:00
parent 4e42394f33
commit 5b58271b92
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
3 changed files with 3 additions and 2 deletions

View File

@ -48,5 +48,6 @@ public void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, int m
terminal.getX(), terminal.getY(), terminal.getWidth(), terminal.getHeight(), false
);
ComputerSidebar.renderBackground(spriteRenderer, computerTextures, leftPos, topPos + sidebarYOffset);
graphics.flush(); // Flush to ensure background textures are drawn before foreground.
}
}

View File

@ -63,5 +63,6 @@ protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, in
// Render sidebar
var spriteRenderer = SpriteRenderer.createForGui(graphics, RenderTypes.GUI_SPRITES);
ComputerSidebar.renderBackground(spriteRenderer, GuiSprites.getComputerTextures(family), leftPos, topPos + sidebarYOffset);
graphics.flush(); // Flush to ensure background textures are drawn before foreground.
}
}

View File

@ -44,9 +44,8 @@ public DynamicImageButton(
@Override
public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
var texture = this.texture.get(isHoveredOrFocused());
RenderSystem.setShaderTexture(0, texture.atlasLocation());
RenderSystem.disableDepthTest();
RenderSystem.disableDepthTest();
graphics.blit(getX(), getY(), 0, width, height, texture);
RenderSystem.enableDepthTest();
}