Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/GUIManager.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return m_PageStack.size(); | return m_PageStack.size(); | ||||
} | } | ||||
void CGUIManager::SwitchPage(const CStrW& pageName, ScriptInterface* srcScriptInterface, JS::HandleValue initData) | void CGUIManager::SwitchPage(const CStrW& pageName, ScriptInterface* srcScriptInterface, JS::HandleValue initData) | ||||
{ | { | ||||
// The page stack is cleared (including the script context where initData came from), | // The page stack is cleared (including the script context where initData came from), | ||||
// therefore we have to clone initData. | // therefore we have to clone initData. | ||||
ScriptRequest rq(srcScriptInterface); | |||||
Script::StructuredClone initDataClone; | Script::StructuredClone initDataClone; | ||||
if (!initData.isUndefined()) | if (!initData.isUndefined()) | ||||
{ | |||||
ScriptRequest rq(srcScriptInterface); | |||||
initDataClone = Script::WriteStructuredClone(rq, initData); | initDataClone = Script::WriteStructuredClone(rq, initData); | ||||
} | |||||
m_PageStack.clear(); | m_PageStack.clear(); | ||||
PushPage(pageName, initDataClone, JS::UndefinedHandleValue); | PushPage(pageName, initDataClone, JS::UndefinedHandleValue); | ||||
} | } | ||||
void CGUIManager::PushPage(const CStrW& pageName, Script::StructuredClone initData, JS::HandleValue callbackFunction) | void CGUIManager::PushPage(const CStrW& pageName, Script::StructuredClone initData, JS::HandleValue callbackFunction) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator