From 221c6ccad1aa177d96356005313f0fe2335211b7 Mon Sep 17 00:00:00 2001 From: Sally Knight Date: Wed, 18 Mar 2026 22:24:12 +0300 Subject: [PATCH] fix: re-enable death screen on java gui was removed accidentally --- Minecraft.Client/Minecraft.cpp | 6 ++++-- Minecraft.Client/UI/Screens/DeathScreen.cpp | 15 ++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 7c74c55c1..3eec0758e 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -546,8 +546,9 @@ void Minecraft::setScreen(Screen* screen) { screen = new TitleScreen(); } else if (player != NULL && !ui.GetMenuDisplayed(player->GetXboxPad()) && player->getHealth() <= 0) { - // screen = new DeathScreen(); - +#ifdef ENABLE_JAVA_GUIS + screen = new DeathScreen(); +#else // 4J Stu - If we exit from the death screen then we are saved as being // dead. In the Java game when you load the game you are still dead, but // this is silly so only show the dead screen if we have died during @@ -557,6 +558,7 @@ void Minecraft::setScreen(Screen* screen) { } else { ui.NavigateToScene(player->GetXboxPad(), eUIScene_DeathMenu, NULL); } +#endif } if (dynamic_cast(screen) != NULL) { diff --git a/Minecraft.Client/UI/Screens/DeathScreen.cpp b/Minecraft.Client/UI/Screens/DeathScreen.cpp index 2384d7f6b..432378076 100644 --- a/Minecraft.Client/UI/Screens/DeathScreen.cpp +++ b/Minecraft.Client/UI/Screens/DeathScreen.cpp @@ -30,8 +30,9 @@ void DeathScreen::buttonClicked(Button* button) { // minecraft.setScreen(new NewLevelScreen(this)); } if (button->id == 2) { - minecraft->setLevel(NULL); - minecraft->setScreen(new TitleScreen()); + // TODO: proper world exits + // minecraft->setLevel(NULL); + // minecraft->setScreen(new TitleScreen()); } } @@ -49,11 +50,11 @@ void DeathScreen::render(int xm, int ym, float a) { Screen::render(xm, ym, a); // 4J - debug code - remove - static int count = 0; - if (count++ == 100) { - count = 0; - buttonClicked(buttons[0]); - } + // static int count = 0; + // if (count++ == 100) { + // count = 0; + // buttonClicked(buttons[0]); + // } } bool DeathScreen::isPauseScreen() { return false; } \ No newline at end of file