Skip to content

Commit

Permalink
WindowScreen: Fix background being draw on top of screen
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Johni0702 authored May 3, 2024
1 parent 93e58c0 commit 990e242
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/gg/essential/elementa/WindowScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 990e242

Please sign in to comment.