Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/scripting/JSInterface_Simulation.cpp
Show All 36 Lines | |||||
JS::Value JSI_Simulation::GetInitAttributes(ScriptInterface::CxPrivate* pCxPrivate) | JS::Value JSI_Simulation::GetInitAttributes(ScriptInterface::CxPrivate* pCxPrivate) | ||||
{ | { | ||||
if (!g_Game) | if (!g_Game) | ||||
return JS::UndefinedValue(); | return JS::UndefinedValue(); | ||||
JSContext* cx = g_Game->GetSimulation2()->GetScriptInterface().GetContext(); | JSContext* cx = g_Game->GetSimulation2()->GetScriptInterface().GetContext(); | ||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | ||||
JS::RootedValue initAttribs(cx); | JS::RootedValue initAttribs(cx, g_Game->GetSimulation2()->GetInitAttributes()); | ||||
g_Game->GetSimulation2()->GetInitAttributes(&initAttribs); | |||||
return pCxPrivate->pScriptInterface->CloneValueFromOtherContext( | return pCxPrivate->pScriptInterface->CloneValueFromOtherContext( | ||||
g_Game->GetSimulation2()->GetScriptInterface(), | g_Game->GetSimulation2()->GetScriptInterface(), | ||||
initAttribs); | initAttribs); | ||||
} | } | ||||
JS::Value JSI_Simulation::GuiInterfaceCall(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name, JS::HandleValue data) | JS::Value JSI_Simulation::GuiInterfaceCall(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name, JS::HandleValue data) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator