mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Dependency following now works
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@95 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -208,6 +208,24 @@ SCRIPT_FUNCTION(set_mask) {
|
||||
}
|
||||
}
|
||||
|
||||
bool parse_enum(const String&, ImageCombine& out);
|
||||
|
||||
SCRIPT_FUNCTION(set_combine) {
|
||||
if (last_update_age() == 0) {
|
||||
SCRIPT_PARAM(String, combine);
|
||||
ScriptImageP image = to_script_image(ctx.getVariable(_("input")));
|
||||
// parse and set combine
|
||||
if (!parse_enum(combine, image->combine)) {
|
||||
throw ScriptError(_("Not a valid combine mode: '") + combine + _("'"));
|
||||
}
|
||||
return image;
|
||||
} else {
|
||||
SCRIPT_RETURN(
|
||||
script_image_up_to_date(ctx.getVariable(_("input")))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SCRIPT_FUNCTION(buildin_image) {
|
||||
if (last_update_age() == 0) {
|
||||
SCRIPT_PARAM(String, input);
|
||||
@@ -223,5 +241,6 @@ void init_script_image_functions(Context& ctx) {
|
||||
ctx.setVariable(_("linear blend"), script_linear_blend);
|
||||
ctx.setVariable(_("masked blend"), script_masked_blend);
|
||||
ctx.setVariable(_("set mask"), script_set_mask);
|
||||
ctx.setVariable(_("set combine"), script_set_combine);
|
||||
ctx.setVariable(_("buildin image"), script_buildin_image);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user