mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +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();
|
screen = new TitleScreen();
|
||||||
} else if (player != NULL && !ui.GetMenuDisplayed(player->GetXboxPad()) &&
|
} else if (player != NULL && !ui.GetMenuDisplayed(player->GetXboxPad()) &&
|
||||||
player->getHealth() <= 0) {
|
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
|
// 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
|
// 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
|
// this is silly so only show the dead screen if we have died during
|
||||||
|
|
@ -557,6 +558,7 @@ void Minecraft::setScreen(Screen* screen) {
|
||||||
} else {
|
} else {
|
||||||
ui.NavigateToScene(player->GetXboxPad(), eUIScene_DeathMenu, NULL);
|
ui.NavigateToScene(player->GetXboxPad(), eUIScene_DeathMenu, NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dynamic_cast<TitleScreen*>(screen) != NULL) {
|
if (dynamic_cast<TitleScreen*>(screen) != NULL) {
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,9 @@ void DeathScreen::buttonClicked(Button* button) {
|
||||||
// minecraft.setScreen(new NewLevelScreen(this));
|
// minecraft.setScreen(new NewLevelScreen(this));
|
||||||
}
|
}
|
||||||
if (button->id == 2) {
|
if (button->id == 2) {
|
||||||
minecraft->setLevel(NULL);
|
// TODO: proper world exits
|
||||||
minecraft->setScreen(new TitleScreen());
|
// 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);
|
Screen::render(xm, ym, a);
|
||||||
|
|
||||||
// 4J - debug code - remove
|
// 4J - debug code - remove
|
||||||
static int count = 0;
|
// static int count = 0;
|
||||||
if (count++ == 100) {
|
// if (count++ == 100) {
|
||||||
count = 0;
|
// count = 0;
|
||||||
buttonClicked(buttons[0]);
|
// buttonClicked(buttons[0]);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeathScreen::isPauseScreen() { return false; }
|
bool DeathScreen::isPauseScreen() { return false; }
|
||||||
Loading…
Reference in a new issue