Delay the exit message box in multiplayer games until after the synchronization is finished, to avoid stacking message boxes.

This was SVN commit r18857.
This commit is contained in:
elexis
2016-10-23 14:49:32 +00:00
parent 6056ebb64f
commit 072cbbe26b
2 changed files with 11 additions and 0 deletions
@@ -580,6 +580,8 @@ function handleNetStatusMessage(message)
return;
}
g_IsNetworkedActive = message.status == "active";
let label = Engine.GetGUIObjectByName("netStatus");
let statusMessage = g_StatusMessageTypes[message.status](message);
label.caption = statusMessage;
@@ -35,6 +35,12 @@ var g_IsController;
*/
var g_IsNetworked = false;
/**
* Whether we have finished the synchronization and
* can start showing simulation related message boxes.
*/
var g_IsNetworkedActive = false;
/**
* True if the connection to the server has been lost.
*/
@@ -685,6 +691,9 @@ function onSimulationUpdate()
*/
function confirmExit()
{
if (g_IsNetworked && !g_IsNetworkedActive)
return;
closeOpenDialogs();
let subject = g_PlayerStateMessages[g_ConfirmExit] + "\n" +