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:
twanvl
2007-06-30 18:23:38 +00:00
parent 04f589637b
commit d5c27a4842
7 changed files with 47 additions and 36 deletions
+5 -2
View File
@@ -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));
}
}
-4
View File
@@ -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" ))); }