mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Card list colors are determined by a script instead of card_list_colors of a choice field (although that is still the default)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@454 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -61,6 +61,9 @@ class ScriptDelayedError : public ScriptValue {
|
||||
ScriptError error; // the error message
|
||||
};
|
||||
|
||||
inline ScriptValueP delayError(const String& m) {
|
||||
return new_intrusive1<ScriptDelayedError>(ScriptError(m));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Iterators
|
||||
|
||||
@@ -129,7 +132,7 @@ ScriptValueP get_member(const map<String,V>& m, const String& name) {
|
||||
if (it != m.end()) {
|
||||
return to_script(it->second);
|
||||
} else {
|
||||
throw ScriptError(_ERROR_2_("has no member", _TYPE_("collection"), name));
|
||||
return delayError(_ERROR_2_("has no member", _TYPE_("collection"), name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +142,7 @@ ScriptValueP get_member(const IndexMap<K,V>& m, const String& name) {
|
||||
if (it != m.end()) {
|
||||
return to_script(*it);
|
||||
} else {
|
||||
throw ScriptError(_ERROR_2_("has no member", _TYPE_("collection"), name));
|
||||
return delayError(_ERROR_2_("has no member", _TYPE_("collection"), name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
// ----------------------------------------------------------------------------- : ScriptValue
|
||||
// Base cases
|
||||
|
||||
inline ScriptValueP delayError(const String& m) {
|
||||
return new_intrusive1<ScriptDelayedError>(ScriptError(m));
|
||||
}
|
||||
|
||||
ScriptValue::operator String() const { return _("[[") + typeName() + _("]]"); }
|
||||
ScriptValue::operator int() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("integer" ))); }
|
||||
ScriptValue::operator double() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("real" ))); }
|
||||
|
||||
Reference in New Issue
Block a user