From 990e24228d00f9c5f6319f20625ecb1ec83877d9 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Fri, 3 May 2024 09:40:41 +0200 Subject: [PATCH] WindowScreen: Fix background being draw on top of screen This was clearly wrong; just no one ever noticed because the vanilla content drawn by `super.onDrawScreen` (e.g. vanilla buttons) is usually empty for Elementa screens. But now that I've seen it, I can't just keep it like that. GitHub: #139 --- src/main/kotlin/gg/essential/elementa/WindowScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/gg/essential/elementa/WindowScreen.kt b/src/main/kotlin/gg/essential/elementa/WindowScreen.kt index bfacc28e..e4488e5d 100644 --- a/src/main/kotlin/gg/essential/elementa/WindowScreen.kt +++ b/src/main/kotlin/gg/essential/elementa/WindowScreen.kt @@ -48,11 +48,11 @@ abstract class WindowScreen @JvmOverloads constructor( afterInitialization() } - super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks) - if (drawDefaultBackground) super.onDrawBackground(matrixStack, 0) + super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks) + // Now, we need to hook up Elementa to this GuiScreen. In practice, Elementa // is not constrained to being used solely inside of a GuiScreen, all the programmer // needs to do is call the [Window] events when appropriate, whenever that may be.