From cbfdef7ba59c199b7fd2595fad5d8cbf21949dc2 Mon Sep 17 00:00:00 2001 From: ViniciusCruzMoura Date: Sat, 21 Mar 2026 15:53:52 -0400 Subject: [PATCH] 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 --- Minecraft.Client/Minecraft.cpp | 1 + Minecraft.Client/UI/Screens/TitleScreen.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index bf98a63cb..19a0a77f1 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -2323,6 +2323,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) { } void Minecraft::stop() { + app.DebugPrintf("Minecraft::stop() SET running = false;\n"); running = false; // keepPolling = false; } diff --git a/Minecraft.Client/UI/Screens/TitleScreen.cpp b/Minecraft.Client/UI/Screens/TitleScreen.cpp index 7806bcf77..27559f215 100644 --- a/Minecraft.Client/UI/Screens/TitleScreen.cpp +++ b/Minecraft.Client/UI/Screens/TitleScreen.cpp @@ -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(); } }