diff --git a/smylib/fabric/src/main/java/net/smyler/smylib/gui/screen/VanillaScreenProxy.java b/smylib/fabric/src/main/java/net/smyler/smylib/gui/screen/VanillaScreenProxy.java index db809c65..a4d7b2de 100644 --- a/smylib/fabric/src/main/java/net/smyler/smylib/gui/screen/VanillaScreenProxy.java +++ b/smylib/fabric/src/main/java/net/smyler/smylib/gui/screen/VanillaScreenProxy.java @@ -19,7 +19,7 @@ public VanillaScreenProxy(Screen screen) { @Override public void render(GuiGraphics guiGraphics, int x, int y, float partialTicks) { - super.render(guiGraphics, x, y, partialTicks); + GameClient game = getGameClient(); WrappedGuiGraphics uiDrawContext = (WrappedGuiGraphics) game.guiDrawContext(); checkState( @@ -28,8 +28,11 @@ public void render(GuiGraphics guiGraphics, int x, int y, float partialTicks) { ); float mouseX = game.mouse().x(); float mouseY = game.mouse().y(); + this.screen.onUpdate(mouseX, mouseY, null); - this.screen.draw(uiDrawContext, 0, 0, mouseX, mouseY, true, true, null); + this.drawBackground(guiGraphics); + super.render(guiGraphics, x, y, partialTicks); + //this.screen.draw(uiDrawContext, 0, 0, mouseX, mouseY, true, true, null); } @Override @@ -92,4 +95,20 @@ public net.smyler.smylib.gui.screen.Screen getScreen() { return screen; } + private void drawBackground(GuiGraphics guiGraphics) { + switch(this.screen.background) { + case NONE: + break; + case DEFAULT: + this.renderBackground(guiGraphics); + break; + case DIRT: + this.renderDirtBackground(guiGraphics); + break; + case OVERLAY: + guiGraphics.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680); + break; + } + } + }