lua: fix Sprite:saveAs() to avoid using the UI

This commit is contained in:
David Capello 2018-09-13 12:28:11 -03:00
parent 99d7a434d4
commit 4a35e20adf

View File

@ -124,10 +124,13 @@ int Sprite_saveAs(lua_State* L)
appCtx->setActiveDocument(doc);
Command* saveCommand =
Commands::instance()->byId(CommandId::SaveFile());
Commands::instance()->byId(CommandId::SaveFileCopyAs());
Params params;
params.set("filename", fn);
appCtx->executeCommand(saveCommand);
doc->setFilename(fn);
appCtx->executeCommand(saveCommand);
}
return 0;
}