fix(jui): ensure serverside unpausing in all scenarios

This commit is contained in:
Sally Knight 2026-03-21 03:05:42 +03:00
parent 24512f44ad
commit 7f39d575a4
3 changed files with 6 additions and 10 deletions

View file

@ -29,6 +29,12 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) {
if (eventKey == Keyboard::KEY_ESCAPE) {
minecraft->setScreen(NULL);
// minecraft->grabMouse(); // 4J - removed
// 4jcraft: moved here from PauseScreen to ensure that serverside
// unpausing is done in all scenarios
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1)
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)FALSE);
}
}

View file

@ -54,15 +54,6 @@ void PauseScreen::init() {
*/
}
void PauseScreen::keyPressed(wchar_t eventCharacter, int eventKey) {
if (eventKey == Keyboard::KEY_ESCAPE && g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1)
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)FALSE);
Screen::keyPressed(eventCharacter, eventKey);
}
void PauseScreen::exitWorld(Minecraft* minecraft, bool save) {
// 4jcraft: made our own static method for use in the java gui (other
// places such as the deathscreen need this)

View file

@ -9,7 +9,6 @@ private:
public:
PauseScreen(); // 4J added
virtual void init();
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
static void exitWorld(Minecraft* minecraft, bool save);
protected: