fix(TitleScreen): handle Exit Game properly with ENABLE_JAVA_GUIS

i noticed the main menu had the same problem as #277 and applied
the same fix
tested with java gui and shiggy, both close correctly now

Signed-off-by: ViniciusCruzMoura <contato.cruz.moura@gmail.com>
This commit is contained in:
ViniciusCruzMoura 2026-03-21 15:53:52 -04:00
parent 2ed79e298a
commit cbfdef7ba5
2 changed files with 8 additions and 1 deletions

View file

@ -2323,6 +2323,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) {
}
void Minecraft::stop() {
app.DebugPrintf("Minecraft::stop() SET running = false;\n");
running = false;
// keepPolling = false;
}

View file

@ -57,6 +57,7 @@ void TitleScreen::tick() {
void TitleScreen::keyPressed(wchar_t eventCharacter, int eventKey) {}
void TitleScreen::init() {
app.DebugPrintf("TitleScreen::init() START\n");
/* 4J - removed
Calendar c = Calendar.getInstance();
c.setTime(new Date());
@ -103,20 +104,25 @@ if (c.get(Calendar.MONTH) + 1 == 11 && c.get(Calendar.DAY_OF_MONTH) == 9) {
void TitleScreen::buttonClicked(Button* button) {
if (button->id == 0) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Options...' if (button->id == 0)\n");
minecraft->setScreen(new OptionsScreen(this, minecraft->options));
}
if (button->id == 1) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Singleplayer' if (button->id == 1)\n");
minecraft->setScreen(new SelectWorldScreen(this));
}
if (button->id == 2) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Multiplayer' if (button->id == 2)\n");
minecraft->setScreen(new JoinMultiplayerScreen(this));
}
if (button->id == 3) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Texture Pack' if (button->id == 3)\n");
// minecraft->setScreen(new TexturePackSelectScreen(this));
// // 4J - TODO put back in
}
if (button->id == 4) {
minecraft->stop();
app.DebugPrintf("TitleScreen::buttonClicked() Exit Game if (button->id == 4)\n");
RenderManager.Close(); //minecraft->stop();
}
}