Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/scripting/JSInterface_Game.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | void JSI_Game::StartGame(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue attribs, int playerID) | ||||
g_Game = new CGame(true); | g_Game = new CGame(true); | ||||
// Convert from GUI script context to sim script context | // Convert from GUI script context to sim script context | ||||
CSimulation2* sim = g_Game->GetSimulation2(); | CSimulation2* sim = g_Game->GetSimulation2(); | ||||
ScriptRequest rqSim(sim->GetScriptInterface()); | ScriptRequest rqSim(sim->GetScriptInterface()); | ||||
JS::RootedValue gameAttribs(rqSim.cx, | JS::RootedValue gameAttribs(rqSim.cx, | ||||
sim->GetScriptInterface().CloneValueFromOtherCompartment(*(pCmptPrivate->pScriptInterface), attribs)); | sim->GetScriptInterface().CloneValueFromOtherCompartment(*(pCmptPrivate->pScriptInterface), attribs, false)); | ||||
g_Game->SetPlayerID(playerID); | g_Game->SetPlayerID(playerID); | ||||
g_Game->StartGame(&gameAttribs, ""); | g_Game->StartGame(&gameAttribs, ""); | ||||
} | } | ||||
void JSI_Game::Script_EndGame(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate)) | void JSI_Game::Script_EndGame(ScriptInterface::CmptPrivate* UNUSED(pCmptPrivate)) | ||||
{ | { | ||||
EndGame(); | EndGame(); | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator