mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Finished documenting scripting system.
This means the documentation is DONE (yay!) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@606 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+8
-3
@@ -56,16 +56,20 @@ The @type@ determines what values of this field contain:
|
||||
Additional properties are available, depending on the type of field:
|
||||
|
||||
! Type Property Type Default Description
|
||||
| @"text"@ @script@ [[type:script]] Script to apply to values of this field after each change.
|
||||
| @"text"@ @script@ [[type:script]] Script to apply to values of this field after each change.<br/>
|
||||
If the script evaluates to a constant (i.e. doesn't use @value@) then values in this field can effectively not be edited.
|
||||
| ^^^ @default@ [[type:script]] Script to determine the value when it is in the default state (not edited).
|
||||
| ^^^ @default name@ [[type:string]] @"Default"@ Name of the default state, currently not used.
|
||||
| ^^^ @multi line@ [[type:boolean]] @false@ Can values of this field contain line breaks?
|
||||
|
||||
| @"choice"@ @script@ [[type:script]] Script to apply to values of this field after each change.
|
||||
| @"choice"@ @script@ [[type:script]] Script to apply to values of this field after each change.<br/>
|
||||
If the script evaluates to a constant (i.e. doesn't use @value@) then values in this field can effectively not be edited.
|
||||
| ^^^ @default@ [[type:script]] Script to determine the value when it is in the default state (not edited).
|
||||
| ^^^ @initial@ [[type:string]] Initial value for new values for this field.
|
||||
| ^^^ @default name@ [[type:string]] @"Default"@ Name of the default state.
|
||||
| ^^^ @choices@ [[type:list]] of [[type:choice]]s Possible values for this field.
|
||||
| ^^^ @choice colors@ [[type:map]] of [[type:color]]s Colors of the choices for statistics graphs.
|
||||
| ^^^ @choice colors cardlist@ [[type:map]] of [[type:color]]s Colors of the choices for lines in the card list,<br/> see also the @card list color script@ property of [[type:game]]s.
|
||||
|
||||
| @"multiple choice"@ <<< <<< <<<
|
||||
'' Multiple choice fields have the same attributes as normal choice fields.''<br/>
|
||||
@@ -74,7 +78,8 @@ Additional properties are available, depending on the type of field:
|
||||
|
||||
| @"boolean"@ ''A boolean field is a choice field with the choices @"yes"@ and @"no"@.'' <<< <<< <<<
|
||||
|
||||
| @"color"@ @script@ [[type:script]] Script to apply to values of this field after each change.
|
||||
| @"color"@ @script@ [[type:script]] Script to apply to values of this field after each change.<br/>
|
||||
If the script evaluates to a constant (i.e. doesn't use @value@) then values in this field can effectively not be edited.
|
||||
| ^^^ @default@ [[type:script]] Script to determine the value when it is in the default state (not edited).
|
||||
| ^^^ @initial@ [[type:string]] Initial color for new values for this field.
|
||||
| ^^^ @default name@ [[type:string]] @"Default"@ Name of the default state.
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ The first element of a list is numbered 0, the next 1, etc.
|
||||
> list[0] # The same thing
|
||||
> list[0+0] # The same thing
|
||||
|
||||
It is possible to iterate over lists using the @for@ construct:
|
||||
> for x in [1,2,3] do "x = {x}. "
|
||||
It is possible to iterate over lists using the @for each@ construct:
|
||||
> for each x in [1,2,3] do "x = {x}. "
|
||||
evaluates to:
|
||||
> "x = 1. x = 2. x = 3. "
|
||||
|
||||
|
||||
+1
-1
@@ -21,6 +21,6 @@ Like lists, maps can be accessed using either the bracket operator, or the dot o
|
||||
> map["k"+"ey"] # The same thing
|
||||
|
||||
It is possible to iterate over the values maps using the @for@ construct:
|
||||
> for x in [one: 1, two: 2] do "x = {x}. "
|
||||
> for each x in [one: 1, two: 2] do "x = {x}. "
|
||||
evaluates to:
|
||||
> "x = 1. x = 2. "
|
||||
|
||||
@@ -26,3 +26,9 @@ Sections between curly braces are interpreted as script code, that is concatenta
|
||||
This can be nested arbitrarily.
|
||||
|
||||
The @+@ operator concatenates strings. Numbers and most other values are automatically converted to strings when needed.
|
||||
|
||||
Using the @[]@ or @.@ operator characters in a string can be selected. 0 is the first character:
|
||||
> "xyz"[0] == "x"
|
||||
> "xyz".0 == "x" # same thing
|
||||
It is an error to select characters outside the string
|
||||
> "xyz".10 # error
|
||||
+3
-3
@@ -108,12 +108,12 @@ The rest of the properties depend on the type of [[type:field]] this style is fo
|
||||
|
||||
! <<< <<< <<< <<<
|
||||
| @"image"@ @mask@ [[type:scriptable]] [[type:filename]] ''none'' A mask to apply to the image, black areas in the mask become transparent, similair to [[fun:set_mask]].
|
||||
@default@ [[type:image|scriptable image]] ''none'' A default image to use when the card has none.
|
||||
| ^^^ @default@ [[type:image|scriptable image]] ''none'' A default image to use when the card has none.
|
||||
|
||||
! <<< <<< <<< <<<
|
||||
| @"symbol"@ @variations@ [[type:list]] of [[type:symbol variation]]s Available variations of the symbol, a variation describes color and border size.
|
||||
| @min aspec ratio@ [[type:double]] @1@ Bounds for the aspect ratio, @width/height@ symbols can take. This can be used to make non-squary symbols.
|
||||
| @max aspec ratio@ [[type:double]] @1@ ^^^
|
||||
| ^^^ @min aspec ratio@ [[type:double]] @1@ Bounds for the aspect ratio, @width/height@ symbols can take. This can be used to make non-squary symbols.
|
||||
| ^^^ @max aspec ratio@ [[type:double]] @1@ ^^^
|
||||
|
||||
! <<< <<< <<< <<<
|
||||
| @"info"@ @font@ [[type:font]] ''Required'' Font to render the text.
|
||||
|
||||
Reference in New Issue
Block a user