Merge pull request #285 from realffqq/dev

fix: re-enable death screen on java gui
This commit is contained in:
Tropical 2026-03-18 14:46:06 -05:00 committed by GitHub
commit f7d8b057f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View file

@ -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<TitleScreen*>(screen) != NULL) {

View file

@ -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; }