Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUISetting.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | bool CGUISetting<CGUIColor>::FromJSVal(JSContext* cx, JS::HandleValue Value, const bool SendMessage) | ||||
if (Value.isString()) | if (Value.isString()) | ||||
{ | { | ||||
CStr name; | CStr name; | ||||
if (!ScriptInterface::FromJSVal(cx, Value, name)) | if (!ScriptInterface::FromJSVal(cx, Value, name)) | ||||
return false; | return false; | ||||
if (!settingValue.ParseString(m_pObject.GetGUI(), name)) | if (!settingValue.ParseString(m_pObject.GetGUI(), name)) | ||||
{ | { | ||||
JSAutoRequest rq(cx); | |||||
elexis: From rP22663 | |||||
JS_ReportError(cx, "Invalid color '%s'", name.c_str()); | JS_ReportError(cx, "Invalid color '%s'", name.c_str()); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
else if (!ScriptInterface::FromJSVal<CColor>(cx, Value, settingValue)) | else if (!ScriptInterface::FromJSVal<CColor>(cx, Value, settingValue)) | ||||
return false; | return false; | ||||
m_pObject.SetSetting<CGUIColor>(m_Name, settingValue, SendMessage); | m_pObject.SetSetting<CGUIColor>(m_Name, settingValue, SendMessage); | ||||
Show All 25 Lines |
Wildfire Games · Phabricator
From rP22663