Merge pull request #300 from ViniciusCruzMoura/java_exit_btn_behaviour

TitleScreen: Fix main menu quit button for JAVA_GUIS, (same issue as #277)
This commit is contained in:
ffqq
2026-03-22 01:29:07 +03:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -2322,6 +2322,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) {
} }
void Minecraft::stop() { void Minecraft::stop() {
app.DebugPrintf("Minecraft::stop() SET running = false;\n");
running = false; running = false;
// keepPolling = false; // keepPolling = false;
} }
+7 -1
View File
@@ -57,6 +57,7 @@ void TitleScreen::tick() {
void TitleScreen::keyPressed(wchar_t eventCharacter, int eventKey) {} void TitleScreen::keyPressed(wchar_t eventCharacter, int eventKey) {}
void TitleScreen::init() { void TitleScreen::init() {
app.DebugPrintf("TitleScreen::init() START\n");
/* 4J - removed /* 4J - removed
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
c.setTime(new Date()); 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) { void TitleScreen::buttonClicked(Button* button) {
if (button->id == 0) { if (button->id == 0) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Options...' if (button->id == 0)\n");
minecraft->setScreen(new OptionsScreen(this, minecraft->options)); minecraft->setScreen(new OptionsScreen(this, minecraft->options));
} }
if (button->id == 1) { if (button->id == 1) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Singleplayer' if (button->id == 1)\n");
minecraft->setScreen(new SelectWorldScreen(this)); minecraft->setScreen(new SelectWorldScreen(this));
} }
if (button->id == 2) { if (button->id == 2) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Multiplayer' if (button->id == 2)\n");
minecraft->setScreen(new JoinMultiplayerScreen(this)); minecraft->setScreen(new JoinMultiplayerScreen(this));
} }
if (button->id == 3) { if (button->id == 3) {
app.DebugPrintf("TitleScreen::buttonClicked() 'Texture Pack' if (button->id == 3)\n");
// minecraft->setScreen(new TexturePackSelectScreen(this)); // minecraft->setScreen(new TexturePackSelectScreen(this));
// // 4J - TODO put back in // // 4J - TODO put back in
} }
if (button->id == 4) { if (button->id == 4) {
minecraft->stop(); app.DebugPrintf("TitleScreen::buttonClicked() Exit Game if (button->id == 4)\n");
RenderManager.Close(); //minecraft->stop();
} }
} }