diff --git a/Minecraft.Client/UI/Screen.cpp b/Minecraft.Client/UI/Screen.cpp index 9098c0094..c3260a893 100644 --- a/Minecraft.Client/UI/Screen.cpp +++ b/Minecraft.Client/UI/Screen.cpp @@ -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); } } diff --git a/Minecraft.Client/UI/Screens/PauseScreen.cpp b/Minecraft.Client/UI/Screens/PauseScreen.cpp index 8c451b4ee..1837a5a99 100644 --- a/Minecraft.Client/UI/Screens/PauseScreen.cpp +++ b/Minecraft.Client/UI/Screens/PauseScreen.cpp @@ -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) diff --git a/Minecraft.Client/UI/Screens/PauseScreen.h b/Minecraft.Client/UI/Screens/PauseScreen.h index 6f71beb09..375d03eb6 100644 --- a/Minecraft.Client/UI/Screens/PauseScreen.h +++ b/Minecraft.Client/UI/Screens/PauseScreen.h @@ -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: