diff --git a/binaries/data/mods/public/gui/session/SessionMessageBox.js b/binaries/data/mods/public/gui/session/SessionMessageBox.js index d14faaab34..3b6170497d 100644 --- a/binaries/data/mods/public/gui/session/SessionMessageBox.js +++ b/binaries/data/mods/public/gui/session/SessionMessageBox.js @@ -31,10 +31,12 @@ class SessionMessageBox if (this.Buttons && this.Buttons[buttonId].onPress) this.Buttons[buttonId].onPress.call(this); - if (Engine.IsGameStarted()) + if (this.ResumeOnClose) resumeGame(); } } SessionMessageBox.prototype.Width = 400; SessionMessageBox.prototype.Height = 200; + +SessionMessageBox.prototype.ResumeOnClose = true; diff --git a/binaries/data/mods/public/gui/session/message_box/QuitConfirmation.js b/binaries/data/mods/public/gui/session/message_box/QuitConfirmation.js index e96ac13fd4..f7753b8e38 100644 --- a/binaries/data/mods/public/gui/session/message_box/QuitConfirmation.js +++ b/binaries/data/mods/public/gui/session/message_box/QuitConfirmation.js @@ -12,7 +12,8 @@ QuitConfirmation.prototype.Buttons = [ { // Translation: Shown in the Dialog that shows up when the game finishes - "caption": translate("Stay") + "caption": translate("Stay"), + "onPress": resumeGame }, { // Translation: Shown in the Dialog that shows up when the game finishes @@ -28,3 +29,5 @@ QuitConfirmation.prototype.Buttons = QuitConfirmation.prototype.Width = 600; QuitConfirmation.prototype.Height = 200; + +QuitConfirmation.prototype.ResumeOnClose = false; diff --git a/source/ps/scripting/JSInterface_Game.cpp b/source/ps/scripting/JSInterface_Game.cpp index 6a85717dc1..7a98c8d30e 100644 --- a/source/ps/scripting/JSInterface_Game.cpp +++ b/source/ps/scripting/JSInterface_Game.cpp @@ -36,11 +36,6 @@ namespace JSI_Game { -bool IsGameStarted() -{ - return g_Game; -} - void StartGame(const ScriptInterface& guiInterface, JS::HandleValue attribs, int playerID, bool storeReplay) { ENSURE(!g_NetServer); @@ -179,7 +174,6 @@ void DumpTerrainMipmap() void RegisterScriptFunctions(const ScriptRequest& rq) { - ScriptFunction::Register<&IsGameStarted>(rq, "IsGameStarted"); ScriptFunction::Register<&StartGame>(rq, "StartGame"); ScriptFunction::Register<&Script_EndGame>(rq, "EndGame"); ScriptFunction::Register<&GetPlayerID>(rq, "GetPlayerID");