From 3c17cec28aec42f6431a2bc9cb0c078fa923f2ba Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 6 Sep 2022 11:39:00 +0200 Subject: [PATCH] Fix images rendering in front of tooltips --- .../unicopia/container/SpellbookScreen.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreen.java b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreen.java index 65814667..b684e449 100644 --- a/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreen.java +++ b/src/main/java/com/minelittlepony/unicopia/container/SpellbookScreen.java @@ -128,6 +128,8 @@ public class SpellbookScreen extends HandledScreen imple drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight, 512, 256); + this.clearAndInit(); + tabs.getAllTabs().forEach(tab -> { Bounds bounds = tab.bounds(); chapters.getCurrentChapter(); @@ -151,6 +153,11 @@ public class SpellbookScreen extends HandledScreen imple drawTexture(matrices, isRight ? bounds.left + bounds.width - 16 - 10 : bounds.left + 10, bounds.top + (bounds.height - 16) / 2, 0, 0, 16, 16, 16, 16); RenderSystem.setShaderTexture(0, TEXTURE); }); + + matrices.push(); + matrices.translate(x, y, 0); + chapters.getCurrentChapter().content().ifPresent(content -> content.draw(matrices, mouseX, mouseY, (IViewRoot)this)); + matrices.pop(); } void drawSlots(MatrixStack matrices, int mouseX, int mouseY, float delta) { @@ -180,8 +187,6 @@ public class SpellbookScreen extends HandledScreen imple @Override protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) { - this.clearAndInit(); - chapters.getCurrentChapter().content().ifPresent(content -> content.draw(matrices, mouseX, mouseY, (IViewRoot)this)); } @Override