Added Package::saveCopy, which is used to implement the write_set_file script function.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1169 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-24 19:48:51 +00:00
parent 2a4a896540
commit 42d40dbd1e
12 changed files with 119 additions and 32 deletions
+1
View File
@@ -96,6 +96,7 @@ These functions are built into the program, other [[type:function]]s can be defi
| [[fun:copy_file]] Copy a file from the [[type:export template]] to the output directory.
| [[fun:write_text_file]] Write a text file to the output directory.
| [[fun:write_image_file]] Write an image file to the output directory.
| [[fun:write_set_file]] Write a MSE set file to the output directory.
! Other functions <<<
| [[fun:trace]] Output a message for debugging purposes.
+1 -1
View File
@@ -18,7 +18,7 @@ This function can only be used in an [[type:export template]], when <tt>create d
| @height@ [[type:int]] Height in pixels to use for the image, by default the size of the image is used if available.
--Examples--
> write_image("image_out.png", linear_blend(...)) == "image_out.png" # image_out.png now contains the given image
> write_image_file(file:"image_out.png", linear_blend(...)) == "image_out.png" # image_out.png now contains the given image
--See also--
| [[fun:write_text_file]] Write a text file to the output directory.
+23
View File
@@ -0,0 +1,23 @@
Function: write_set_file
--Usage--
> write_set_file(set:the_set, file: filename)
Write the current set to a file in the output directory.
If a file with the given name already exists it is overwritten.
Returns the name of the file written.
This function can only be used in an [[type:export template]], when <tt>create directory</tt> is true.
--Parameters--
! Parameter Type Description
| @set@ [[type:set]] Set to write to the file.
| @file@ [[type:string]] Name of the file to write to
--Examples--
> write_set_file(file:"the-set.mse-set") == "the-set.mse-set" # the-set.mse-set now contains the set
--See also--
| [[fun:write_image_file]] Write an image file to the output directory.
| [[fun:write_text_file]] Write a text file to the output directory.
+1 -1
View File
@@ -16,7 +16,7 @@ This function can only be used in an [[type:export template]], when <tt>create d
| @file@ [[type:string]] Name of the file to write to
--Examples--
> write_file("index.html", lots_of_html_code) == "index.html" # index.html now contains the given text
> write_text_file(file:"index.html", lots_of_html_code) == "index.html" # index.html now contains the given text
--See also--
| [[fun:write_image_file]] Write an image file to the output directory.