mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Use KaywordParamValue objects for sanity checking reminder text scripts, this fixes:
"Error message "String param1 has no member 'value'" when using param1.value in custom keywords." git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1002 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -181,8 +181,10 @@ bool KeywordReminderTextValue::checkScript(const ScriptP& script) {
|
|||||||
Context& ctx = set.cards.empty() ? set.getContext() : set.getContext(set.cards.front());
|
Context& ctx = set.cards.empty() ? set.getContext() : set.getContext(set.cards.front());
|
||||||
LocalScope scope(ctx);
|
LocalScope scope(ctx);
|
||||||
for (size_t i = 0 ; i < keyword.parameters.size() ; ++i) {
|
for (size_t i = 0 ; i < keyword.parameters.size() ; ++i) {
|
||||||
String param = String(_("param")) << (int)(i+1);
|
const KeywordParam& kwp = *keyword.parameters[i];
|
||||||
ctx.setVariable(param, to_script(param));
|
String param_name = String(_("param")) << (int)(i+1);
|
||||||
|
String param_value = _("<atom-kwpph>") + (kwp.placeholder.empty() ? kwp.name : kwp.placeholder) + _("</atom-kwpph>");
|
||||||
|
ctx.setVariable(param_name, new_intrusive4<KeywordParamValue>(kwp.name, _(""), _(""), param_value));
|
||||||
}
|
}
|
||||||
script->eval(ctx);
|
script->eval(ctx);
|
||||||
errors.clear();
|
errors.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user