mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-27 20:03:35 +00:00
Merge pull request #285 from realffqq/dev
fix: re-enable death screen on java gui
This commit is contained in:
commit
f7d8b057f2
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
Loading…
Reference in a new issue