mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
EnumReader now warns about the correct string,
parse_enum function throws if the string can not be parsed git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1341 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(SymbolVariationP);
|
||||
|
||||
bool parse_enum(const String&, ImageCombine& out);
|
||||
void parse_enum(const String&, ImageCombine& out);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Utility
|
||||
|
||||
@@ -56,9 +56,7 @@ SCRIPT_FUNCTION(combine_blend) {
|
||||
SCRIPT_PARAM(GeneratedImageP, image1);
|
||||
SCRIPT_PARAM(GeneratedImageP, image2);
|
||||
ImageCombine image_combine;
|
||||
if (!parse_enum(combine, image_combine)) {
|
||||
throw ScriptError(_("Not a valid combine mode: '") + combine + _("'"));
|
||||
}
|
||||
parse_enum(combine, image_combine);
|
||||
return new_intrusive3<CombineBlendImage>(image1, image2, image_combine);
|
||||
}
|
||||
|
||||
@@ -78,9 +76,7 @@ SCRIPT_FUNCTION(set_combine) {
|
||||
SCRIPT_PARAM(String, combine);
|
||||
SCRIPT_PARAM_C(GeneratedImageP, input);
|
||||
ImageCombine image_combine;
|
||||
if (!parse_enum(combine, image_combine)) {
|
||||
throw ScriptError(_("Not a valid combine mode: '") + combine + _("'"));
|
||||
}
|
||||
parse_enum(combine, image_combine);
|
||||
return new_intrusive2<SetCombineImage>(input, image_combine);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user