mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Documented add cards scripts and the new_card function
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1149 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -79,11 +79,14 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[fun:set_combine]] Change how the image should be combined with the background.
|
||||
| [[fun:saturate]] Saturate/desaturate an image.
|
||||
| [[fun:enlarge]] Enlarge an image by putting a border around it.
|
||||
| [[fun:crop]] Crop an image, giving only a small subset of it.
|
||||
| [[fun:crop]] Crop an image, giving only a small subset of it.
|
||||
| [[fun:drop_shadow]] Add a drop shadow to an image.
|
||||
| [[fun:symbol_variation]] Render a variation of a [[type:symbol]].
|
||||
| [[fun:built_in_image]] Return an image built into the program.
|
||||
|
||||
! Cards <<<
|
||||
| [[fun:new_card]] Construct a new [[type:card]] object.
|
||||
|
||||
! HTML export <<<
|
||||
| [[fun:to_html]] Convert [[type:tagged text]] to html.
|
||||
| [[fun:symbols_to_html]] Convert text to html using a [[type:symbol font]].
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
Function: new_card
|
||||
|
||||
--Usage--
|
||||
> new_card(map_of_field_names_to_values)
|
||||
|
||||
Create a new [[type:card]] object not already in the set.
|
||||
|
||||
The argument is a map of values to set, for example @new_card([name: "My Card"])@ creates a card with the name @"My Card"@, and all other fields at their default value.
|
||||
|
||||
NOTE: you should use underscores instead of spaces in field names.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:map]] of field names to field values Field values to set
|
||||
|
||||
--Examples--
|
||||
> # Create a new card
|
||||
> my_card := new_card(
|
||||
> [ name: "My Card"
|
||||
>> , type: "Super cool"
|
||||
>> , rule_text: "This card is <i>mine</i>!"
|
||||
> ])
|
||||
>
|
||||
> # Write an image of the card to a file
|
||||
> write_image_file(my_card, file: "my_card.jpg")
|
||||
@@ -0,0 +1,31 @@
|
||||
Data type: add cards script
|
||||
|
||||
DOC_MSE_VERSION: since 0.3.7
|
||||
|
||||
--Overview--
|
||||
|
||||
A script to add multiple cards to the set at once.
|
||||
|
||||
--Properties--
|
||||
! Property Type Default Description
|
||||
| @name@ [[type:string]] Name of this script; appears in the menu.
|
||||
| @description@ [[type:string]] @""@ Description of this script; appears in the status bar.
|
||||
| @enabled@ [[type:scriptable]] [[type:boolean]] @true@ Is this script enabled?
|
||||
| @script@ [[type:script]] Script that produces the cards.<br>
|
||||
This script should return a [[type:list]] of [[type:card]]s.
|
||||
The [[fun:new_card]] function can be used to make new cards.
|
||||
|
||||
--Example--
|
||||
>add cards script:
|
||||
> name: &Basic Lands
|
||||
> description: Adds 5 basic lands to the set.
|
||||
> script:
|
||||
> [ new_card([name: "Plains", super_type: "Basic Land", sub_type: "Plains"])
|
||||
> , new_card([name: "Island", super_type: "Basic Land", sub_type: "Island"])
|
||||
> , new_card([name: "Swamp", super_type: "Basic Land", sub_type: "Swamp"])
|
||||
> , new_card([name: "Mountain", super_type: "Basic Land", sub_type: "Mountain"])
|
||||
> , new_card([name: "Forest", super_type: "Basic Land", sub_type: "Forest"])
|
||||
> ]
|
||||
|
||||
When invoked, this script will add the five basic lands to the set.
|
||||
|
||||
@@ -46,6 +46,8 @@ Such a package contains a [[file:format|data file]] called <tt>game</tt> that ha
|
||||
| @keyword parameter types@ [[type:list]] of [[type:keyword param type]]s Types of parameters available to keywords.
|
||||
| @keywords@ [[type:list]] of [[type:keyword]]s Standard keywords for this game.
|
||||
| @word lists@ [[type:list]] of [[type:word list]]s Word lists that can be used by text fields.
|
||||
| @add cards script@ [[type:list]] of [[type:add cards script]]s DOC_MSE_VERSION: since 0.3.7
|
||||
A list of scripts for convienently adding multiple cards to a set.
|
||||
|
||||
--Examples--
|
||||
Look at the game files in the standard MSE distribution for examples.
|
||||
|
||||
@@ -27,6 +27,8 @@ These contain several properties, similair to the file types. But they are part
|
||||
| [[type:keyword param type]] A type of parameters for keywords.
|
||||
| [[type:statistics dimension]] A dimension for the statistics panel.
|
||||
| [[type:statistics category]] A category for the statistics panel.
|
||||
| [[type:word list]] A list of words that can be used for a drop down list in text fields.
|
||||
| [[type:add cards script]] A script for convienently adding multiple cards to a set.
|
||||
| [[type:font]] Description of a font.
|
||||
| [[type:symbol part]] Part of a [[type:symbol]].
|
||||
| [[type:control point]] A point on in a symbol part.
|
||||
|
||||
Reference in New Issue
Block a user