Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/scripting/JSInterface_IGUIObject.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | if (propName.substr(0, 2) == "on") | ||||
CStr eventName(CStr(propName.substr(2)).LowerCase()); | CStr eventName(CStr(propName.substr(2)).LowerCase()); | ||||
e->SetScriptHandler(eventName, vpObj); | e->SetScriptHandler(eventName, vpObj); | ||||
return result.succeed(); | return result.succeed(); | ||||
} | } | ||||
if (e->SettingExists(propName)) | if (e->SettingExists(propName)) | ||||
return e->m_Settings[propName]->FromJSVal(cx, vp) ? result.succeed() : result.fail(JSMSG_TYPE_ERR_BAD_ARGS); | return e->m_Settings[propName]->FromJSVal(cx, vp, true) ? result.succeed() : result.fail(JSMSG_TYPE_ERR_BAD_ARGS); | ||||
JS_ReportError(cx, "Property '%s' does not exist!", propName.c_str()); | JS_ReportError(cx, "Property '%s' does not exist!", propName.c_str()); | ||||
return result.fail(JSMSG_UNDEFINED_PROP); | return result.fail(JSMSG_UNDEFINED_PROP); | ||||
} | } | ||||
void JSI_IGUIObject::init(ScriptInterface& scriptInterface) | void JSI_IGUIObject::init(ScriptInterface& scriptInterface) | ||||
{ | { | ||||
scriptInterface.DefineCustomObjectType(&JSI_class, nullptr, 1, nullptr, JSI_methods, nullptr, nullptr); | scriptInterface.DefineCustomObjectType(&JSI_class, nullptr, 1, nullptr, JSI_methods, nullptr, nullptr); | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator