From e73738d7946ff06fbed267de76f447fbddb57bbe Mon Sep 17 00:00:00 2001 From: leper Date: Thu, 2 Jan 2014 16:30:24 +0000 Subject: [PATCH] Do not pause multiplayer games if one player opens a dialog. Patch by boeseRaupe. Fixes #2275. This was SVN commit r14481. --- binaries/data/mods/public/gui/session/menu.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/binaries/data/mods/public/gui/session/menu.js b/binaries/data/mods/public/gui/session/menu.js index 6404ac520f..ee88cd67f2 100644 --- a/binaries/data/mods/public/gui/session/menu.js +++ b/binaries/data/mods/public/gui/session/menu.js @@ -86,14 +86,12 @@ function updateMenuPosition(dt) // Opens the menu by revealing the screen which contains the menu function openMenu() { -// playButtonSound(); isMenuOpen = true; } // Closes the menu and resets position function closeMenu() { -// playButtonSound(); isMenuOpen = false; } @@ -111,7 +109,7 @@ function settingsMenuButton() { closeMenu(); closeOpenDialogs(); - openSettings(true); + openSettings(); } function chatMenuButton() @@ -180,11 +178,10 @@ function openSave() Engine.PushGuiPage("page_savegame.xml", {"gameDataCallback": getSavedGameData, "closeCallback": resumeGame}); } -function openSettings(pause) +function openSettings() { getGUIObjectByName("settingsDialogPanel").hidden = false; - if (pause) - pauseGame(); + pauseGame(); } function closeSettings(resume) @@ -198,7 +195,6 @@ function openChat() { getGUIObjectByName("chatInput").focus(); // Grant focus to the input area getGUIObjectByName("chatDialogPanel").hidden = false; - } function closeChat() @@ -521,8 +517,14 @@ function toggleGameSpeed() gameSpeed.hidden = !gameSpeed.hidden; } +/** + * Pause the game in single player mode. + */ function pauseGame() { + if (g_IsNetworked) + return; + getGUIObjectByName("pauseButtonText").caption = RESUME; getGUIObjectByName("pauseOverlay").hidden = false; setPaused(true);