Changeset View
Changeset View
Standalone View
Standalone View
source/ps/ModInstaller.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | CModInstaller::ModInstallationResult CModInstaller::Install( | ||||
m_VFS->Clear(); | m_VFS->Clear(); | ||||
if (modinfo_status != PSRETURN_OK) | if (modinfo_status != PSRETURN_OK) | ||||
return FAIL_ON_MOD_LOAD; | return FAIL_ON_MOD_LOAD; | ||||
// Extract the name of the mod | // Extract the name of the mod | ||||
CStr modName; | CStr modName; | ||||
{ | { | ||||
ScriptInterface scriptInterface("Engine", "ModInstaller", scriptContext); | ScriptInterface scriptInterface("Engine", "ModInstaller", scriptContext); | ||||
ScriptInterface::Request rq(scriptInterface); | ScriptRequest rq(scriptInterface); | ||||
JS::RootedValue json_val(rq.cx); | JS::RootedValue json_val(rq.cx); | ||||
if (!scriptInterface.ParseJSON(modinfo.GetAsString(), &json_val)) | if (!scriptInterface.ParseJSON(modinfo.GetAsString(), &json_val)) | ||||
return FAIL_ON_PARSE_JSON; | return FAIL_ON_PARSE_JSON; | ||||
JS::RootedObject json_obj(rq.cx, json_val.toObjectOrNull()); | JS::RootedObject json_obj(rq.cx, json_val.toObjectOrNull()); | ||||
JS::RootedValue name_val(rq.cx); | JS::RootedValue name_val(rq.cx); | ||||
if (!JS_GetProperty(rq.cx, json_obj, "name", &name_val)) | if (!JS_GetProperty(rq.cx, json_obj, "name", &name_val)) | ||||
return FAIL_ON_EXTRACT_NAME; | return FAIL_ON_EXTRACT_NAME; | ||||
Show All 38 Lines |
Wildfire Games · Phabricator