mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 11:25:45 +00:00
Move static GUI<>::SetSetting operating on IGUIObject to a member IGUIObject::SetSetting.
Remove PSERROR codes from SetSetting (let std::map throw an out_of_range if a caller wants to Set a setting that doesn't exist without having checked with SettingExists, equal to GetSetting from92b6cdfeab). That also simplifies std::function SetSettingWrap construct from0a7d0ecddeto void IGUIObject::SettingChanged. Don't trigger debug_warn or exceptions in GUITooltip::ShowTooltip if the XML author specified wrong tooltip input, and dodge another dynamic_cast. Rename existing IGUIObject::SetSetting to IGUIObject::SetSettingFromString and comment that it is purposed for parsing XML files. Remove SetSetting default value, so that authors are made aware explicitly of the need to decide the function broadcasting a message, refsd87057b1c0,719f2d7967, ... Change const bool& SkipMessage to const bool SendMessage, so that a positive value relates to a positive action. Clean AddSettings whitespace and integer types. Differential Revision: https://code.wildfiregames.com/D2231 Tested on: gcc 9.1.0, clang 8.0.1, Jenkins Comments By: Philip on IRC on 2010-07-24 on GUIUtil being ugly, in case that one counts This was SVN commit r22796.
This commit is contained in:
@@ -168,7 +168,7 @@ bool JSI_IGUIObject::setProperty(JSContext* cx, JS::HandleObject obj, JS::Handle
|
||||
}
|
||||
|
||||
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());
|
||||
return result.fail(JSMSG_UNDEFINED_PROP);
|
||||
|
||||
Reference in New Issue
Block a user