From e9766ed2a149c291b5a0b45fc7f037f3f44f83f7 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 15:44:05 +0200 Subject: [PATCH 1/2] FEAT: Option button in PauseScreen --- src/client/gui/screens/OptionsScreen.cpp | 6 +++++- src/client/gui/screens/PauseScreen.cpp | 22 +++++++++++++++++----- src/client/gui/screens/PauseScreen.h | 4 +++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index adeb5be..b1e7828 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -153,7 +153,11 @@ void OptionsScreen::buttonClicked(Button* button) { if (button == btnClose) { minecraft->options.save(); - minecraft->screenChooser.setScreen(SCREEN_STARTMENU); + if (minecraft->screen != NULL) { + minecraft->setScreen(NULL); + } else { + minecraft->screenChooser.setScreen(SCREEN_STARTMENU); + } } else if (button->id > 1 && button->id < 7) { int categoryButton = button->id - categoryButtons[0]->id; diff --git a/src/client/gui/screens/PauseScreen.cpp b/src/client/gui/screens/PauseScreen.cpp index aac6f21..46d99cd 100755 --- a/src/client/gui/screens/PauseScreen.cpp +++ b/src/client/gui/screens/PauseScreen.cpp @@ -5,12 +5,16 @@ #include "../../../util/Mth.h" #include "../../../network/RakNetInstance.h" #include "../../../network/ServerSideNetworkHandler.h" +#include "client/Options.h" +#include "client/gui/components/Button.h" +#include "client/gui/screens/OptionsScreen.h" PauseScreen::PauseScreen(bool wasBackPaused) : saveStep(0), visibleTime(0), bContinue(0), bQuit(0), + bOptions(0), bQuitAndSaveLocally(0), bServerVisibility(0), // bThirdPerson(0), @@ -39,18 +43,21 @@ PauseScreen::~PauseScreen() { delete bQuit; delete bQuitAndSaveLocally; delete bServerVisibility; + delete bOptions; // delete bThirdPerson; } void PauseScreen::init() { if (minecraft->useTouchscreen()) { bContinue = new Touch::TButton(1, "Back to game"); + bOptions = new Touch::TButton(5, "Options"); bQuit = new Touch::TButton(2, "Quit to title"); bQuitAndSaveLocally = new Touch::TButton(3, "Quit and copy map"); bServerVisibility = new Touch::TButton(4, ""); // bThirdPerson = new Touch::TButton(5, "Toggle 3:rd person view"); } else { bContinue = new Button(1, "Back to game"); + bOptions = new Button(5, "Options"); bQuit = new Button(2, "Quit to title"); bQuitAndSaveLocally = new Button(3, "Quit and copy map"); bServerVisibility = new Button(4, ""); @@ -59,7 +66,7 @@ void PauseScreen::init() { buttons.push_back(bContinue); buttons.push_back(bQuit); - + buttons.push_back(bOptions); // bSound.updateImage(&minecraft->options); bThirdPerson.updateImage(&minecraft->options); bHideGui.updateImage(&minecraft->options); @@ -99,21 +106,24 @@ void PauseScreen::setupPositions() { saveStep = 0; int yBase = 16; - bContinue->width = bQuit->width = /*bThirdPerson->w =*/ 160; + bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 160; bQuitAndSaveLocally->width = bServerVisibility->width = 160; bContinue->x = (width - bContinue->width) / 2; bContinue->y = yBase + 32 * 1; + bOptions->x = (width - bOptions->width) / 2; + bOptions->y = yBase + 32 * 2; + bQuit->x = (width - bQuit->width) / 2; - bQuit->y = yBase + 32 * 2; + bQuit->y = yBase + 32 * 3; #if APPLE_DEMO_PROMOTION bQuit->y += 16; #endif bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2; - bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 3; + bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 4; // bSound.y = bThirdPerson.y = 8; // bSound.x = 4; @@ -157,7 +167,9 @@ void PauseScreen::buttonClicked(Button* button) { if (button->id == bQuitAndSaveLocally->id) { minecraft->leaveGame(true); } - + if (button->id == bOptions->id) { + minecraft->setScreen(new OptionsScreen()); + } if (button->id == bServerVisibility->id) { if (minecraft->raknetInstance && minecraft->netCallback && minecraft->raknetInstance->isServer()) { ServerSideNetworkHandler* ss = (ServerSideNetworkHandler*) minecraft->netCallback; diff --git a/src/client/gui/screens/PauseScreen.h b/src/client/gui/screens/PauseScreen.h index 6f6a078..4098511 100755 --- a/src/client/gui/screens/PauseScreen.h +++ b/src/client/gui/screens/PauseScreen.h @@ -33,7 +33,9 @@ private: Button* bQuit; Button* bQuitAndSaveLocally; Button* bServerVisibility; -// Button* bThirdPerson; + Button* bOptions; + + // Button* bThirdPerson; // OptionButton bSound; OptionButton bThirdPerson; From 6e0615c0bc2d0adeb729481a0d3378510fc50bcd Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Sat, 21 Mar 2026 16:03:51 +0200 Subject: [PATCH 2/2] FEAT: Auto jump in settings (again) --- data/lang/en_US.lang | 2 +- src/client/Minecraft.cpp | 1 - src/client/gui/Gui.cpp | 2 +- src/client/gui/screens/OptionsScreen.cpp | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/lang/en_US.lang b/data/lang/en_US.lang index d4b83d5..4bb15e2 100755 --- a/data/lang/en_US.lang +++ b/data/lang/en_US.lang @@ -153,7 +153,7 @@ options.group.tweaks=Tweaks options.allowSprint=Allow sprint options.barOnTop=HUD above inventory options.rpiCursor=Show Raspberry PI cursor -options.autojump=Auto Jump +options.autoJump=Auto Jump options.thirdperson=Third Person options.servervisible=Server Visible options.sensitivity=Sensitivity diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 5b03708..8d38c06 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1228,7 +1228,6 @@ void Minecraft::reloadOptions() { if ((wasTouchscreen != useTouchscreen()) || (inputHolder == 0)) _reloadInput(); - // TODO: // user->name = options.username; LOGI("Reloading-options\n"); diff --git a/src/client/gui/Gui.cpp b/src/client/gui/Gui.cpp index cf1ab58..b7c462e 100755 --- a/src/client/gui/Gui.cpp +++ b/src/client/gui/Gui.cpp @@ -349,7 +349,7 @@ void Gui::setNowPlaying(const std::string& string) { void Gui::displayClientMessage(const std::string& messageId) { //Language language = Language.getInstance(); //std::string languageString = language.getElement(messageId); - addMessage(std::string("Client message: ") + messageId); + addMessage(messageId); } void Gui::renderVignette(float br, int w, int h) { diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index b1e7828..a7875dd 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -213,7 +213,8 @@ void OptionsScreen::generateOptionScreens() { // // Controls Pane optionPanes[2]->addOptionItem(OPTIONS_INVERT_Y_MOUSE, minecraft) - .addOptionItem(OPTIONS_USE_TOUCHSCREEN, minecraft); + .addOptionItem(OPTIONS_USE_TOUCHSCREEN, minecraft) + .addOptionItem(OPTIONS_AUTOJUMP, minecraft); for (int i = OPTIONS_KEY_FORWARD; i <= OPTIONS_KEY_USE; i++) { optionPanes[2]->addOptionItem((OptionId)i, minecraft);