Remove Engine.IsGameStarted completely

Revert 89e511def9

refs: #4211, bc6da5e3f2

Accepted By: elexis
Differential Revision: https://code.wildfiregames.com/D5152
This was SVN commit r27883.
This commit is contained in:
phosit 2023-10-12 19:20:56 +00:00
parent 0eae7442b9
commit 29b57026a6
3 changed files with 7 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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");