mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-24 10:22:58 +00:00
fix(jui): ensure serverside unpausing in all scenarios
This commit is contained in:
parent
24512f44ad
commit
7f39d575a4
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue