mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Lots of data type descriptions
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@569 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
Enumeration: alignment
|
||||
|
||||
Specifies how text and images are aligned in boxes.
|
||||
An alignment consists of a vertical and a horizontal component.
|
||||
Optionally there are some modifiers.
|
||||
|
||||
--Script syntax--
|
||||
In scripts, alignment is passed around as a string.
|
||||
|
||||
--Possible values--
|
||||
The value is a combination of one or more flags, separated by spaces.
|
||||
! Value Description
|
||||
| @left@ Horizontally, align at the left
|
||||
| @center@ Horizontally, align in the middle
|
||||
| @right@ Horizontally, align at the right
|
||||
| @top@ Vertically, align at the top
|
||||
| @middle@ Vertically, align in the middle
|
||||
| @bottom@ Vertically, align at the bottom
|
||||
| @justify@ Move characters apart or together to exactly fill the width of the box.
|
||||
| @justify-words@ Move words apart or together to exactly fill the width of the box.
|
||||
| @justify-overflow@ If the text becomes to long, move characters closer together.
|
||||
| @stretch Stretch text, so it always fills the width of the box.<br/>
|
||||
For images; stretch them, but preserve the aspect ratio.
|
||||
| @stretch-overflow@ Stretch (compress) the text when it becomes too long.
|
||||
|
||||
--Examples--
|
||||
> alignment: top left
|
||||
> alignment: middle center
|
||||
> alignment: { "middle" + " " + "left" }
|
||||
@@ -0,0 +1,24 @@
|
||||
Primitive type: boolean
|
||||
|
||||
A boolean is either @true@ or @false@.
|
||||
|
||||
In a script, numbers are implicitly converted to booleans, a non-zero number is @true@, 0 is @false@.
|
||||
|
||||
When converted to a number, @true@ becomes @1@ and @false@ becomes @0@.
|
||||
|
||||
The strings @"yes"@ and @"no"@ can also be converted to booleans.
|
||||
|
||||
--File syntax--
|
||||
> boolean: true
|
||||
> boolean: false
|
||||
|
||||
--Script syntax--
|
||||
> true or false
|
||||
|
||||
The operators @or@, @and@ and @xor@ combine two booleans:
|
||||
! @a@ @b@ <tt>a or b</tt> <tt>a and b</tt> <tt>a xor b</tt>
|
||||
| @false@ @false@ @false@ @false@ @false@
|
||||
| @false@ @true@ @true@ @false@ @true@
|
||||
| @true@ @false@ @true@ @false@ @true@
|
||||
| @true@ @true@ @true@ @true@ @false@
|
||||
|
||||
+36
-2
@@ -1,7 +1,41 @@
|
||||
==Data type: image combine type==
|
||||
Enumeration: image combine type
|
||||
|
||||
This specifies how an image is to be combined with the background.
|
||||
This is similair to the feature found in more advanced drawing programs.
|
||||
|
||||
The formula's are from [[http://www.pegtop.net/delphi/articles/blendmodes/]].
|
||||
|
||||
--Script syntax--
|
||||
In scripts, combine modes are stored as a string.
|
||||
|
||||
--Possible values--
|
||||
| overlay
|
||||
! Value Description
|
||||
| @normal@ Normal behaviour, don't combine.
|
||||
| @add@
|
||||
| @subtract@
|
||||
| @stamp@
|
||||
| @difference@
|
||||
| @negation@
|
||||
| @multiply@
|
||||
| @darken@
|
||||
| @lighten@
|
||||
| @color dodge@
|
||||
| @color burn@
|
||||
| @screen@
|
||||
| @overlay@
|
||||
| @hard light@
|
||||
| @soft light@
|
||||
| @reflect@
|
||||
| @glow@
|
||||
| @freeze@
|
||||
| @heat@
|
||||
| <tt>and</tt> Bitwise and
|
||||
| <tt>or</tt> Bitwise or
|
||||
| <tt>xor</tt> Bitwise xot
|
||||
| @shadow@ Dark colors normally, white colors darken the background.
|
||||
| @symmetric overlay@ @(overlay(a,b) + overlay(b,a)) / 2@
|
||||
|
||||
--Examples--
|
||||
> combine: overlay
|
||||
> combine_image(image1: ..., image2: ..., combine: "shadow")
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Enumeration: direction
|
||||
|
||||
Specifies the direction of text flow in a text box.
|
||||
|
||||
--Script syntax--
|
||||
In scripts, direction is passed around as a string.
|
||||
|
||||
--Possible values--
|
||||
! Value Description
|
||||
| @left to right@ Text starts at the left.
|
||||
| @right to left@ Text starts at the right ''(currently not implemented)''
|
||||
| @top to bottom@ Text starts at the top, each character is on a new line.
|
||||
| @bottom to top@ Text starts at the bottom ''(currently not implemented)''
|
||||
| @horizontal@ Same as @left to right@.
|
||||
| @vertical@ Same as @top to bottom@.
|
||||
|
||||
--Examples--
|
||||
> direction: horizontal
|
||||
> direction: top to bottom
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Primitive type: real number
|
||||
|
||||
Real or floating point numbers are numbers with a decimal point.
|
||||
|
||||
Conversio from integer to real numbers happens automatically in scripting.
|
||||
|
||||
--File syntax--
|
||||
> something: 123
|
||||
> something: 0.5
|
||||
|
||||
--Script syntax--
|
||||
> 123.1 + 456 * -1
|
||||
|
||||
--See also--
|
||||
* [[type:int]]
|
||||
@@ -0,0 +1,10 @@
|
||||
Primitve type: filename
|
||||
|
||||
Filenames are regular [[type:string]]s, pointing to a file.
|
||||
There are two types of filenames, relative and absolute:
|
||||
! Syntax Description
|
||||
| <tt>path/to/file</tt> A relative file, this is retrieved from the current package.
|
||||
i.e. for a filename in a stylesheet, the file is retrieved from that stylesheet.
|
||||
| <tt>/package/path/to/file</tt> An absolute filename includes the name of the package. This is a package somewhere in the MSE data directory.
|
||||
|
||||
Don't forget the double quotes (@""@) in scripts.
|
||||
+5
-5
@@ -20,21 +20,21 @@ Such a package contains a data file called <tt>game</tt> that has the following
|
||||
| @mse version@ [[type:version]] ''required'' Version of MSE this game is made for.
|
||||
| @short name@ [[type:string]] file name A short name of this game, for the 'new set' list.
|
||||
| @full name@ [[type:string]] file name A longer name of this game.
|
||||
| @icon@ [[type:filename]] ''none'' Filename of an icon for this card, for the 'new set' list.
|
||||
| @icon@ [[type:filename]] ''none'' Filename of an icon / preview for this game, for the 'new set' list.
|
||||
| @position hint@ [[type:int]] ∞ Where to place this item in the 'new set' list? Lower numbers come first.
|
||||
| @version@ [[type:version]] @0.0.0@ Version number of this package.
|
||||
| @depends on@ [[type:list]] of [[type:dependency]]s
|
||||
Packages this package depends on.
|
||||
|
||||
| '''Specific to games''' <<< <<< <<<
|
||||
| @init script@ [[type:script]] @;@ Script to run when this game is loaded, can set variables
|
||||
| @init script@ [[type:script]] @;@ Script to run when this game is loaded,<br/> can set variables
|
||||
to be used by other scripts in this game or stylesheets using it.
|
||||
| @set fields@ [[type:list]] of [[type:field]]s Fields for the styling panel.
|
||||
| @default set style@ [[type:indexmap]] of [[type:style]]s Default style for the set fields, can be overriden by the stylesheet.
|
||||
| @card fields@ [[type:list]] of [[type:field]]s Fields for each card.
|
||||
| @card list color script@ [[type:script]] from fields Script that determines the color of an item in the card list. If not set uses the @card list colors@ property of the first card field that has it.
|
||||
| @statistics dimensions@ [[type:list]] of [[type:statistics dimension]]s from fields Dimensions for statistics, a dimension is rougly the same as an axis. By default all card fields with 'show statistics' set to true are used.
|
||||
| @statistics categories@ [[type:list]] of [[type:statistics category]]s from dimensions Choices shown on the statistics panel. By default all statistics dimensions are used.
|
||||
| @card list color script@ [[type:script]] from fields Script that determines the color of an item in the card list. <br/>If not set uses the @card list colors@ property of the first card field that has it.
|
||||
| @statistics dimensions@ [[type:list]] of [[type:statistics dimension]]s from fields Dimensions for statistics, a dimension is rougly the same as an axis. <br/>By default all card fields with 'show statistics' set to true are used.
|
||||
| @statistics categories@ [[type:list]] of [[type:statistics category]]s from dimensions Choices shown on the statistics panel. <br/>By default all statistics dimensions are used.
|
||||
| @has keywords@ [[type:boolean]] @false@ Does this game use keywords? Should the keywords tab be available?
|
||||
| @keyword match script@ [[type:script]] @;@ Script to apply to the @match@ property of keywords.
|
||||
| @keyword modes@ [[type:list]] of [[type:keyword mode]]s Choices for the 'mode' property of keywords.
|
||||
|
||||
+26
-11
@@ -18,13 +18,18 @@ These are the 'major' data types that are written directly to [[file:package]]s.
|
||||
|
||||
--Compound types--
|
||||
These contain several properties, similair to the file types. But they are part of some other file type.
|
||||
| [[type:field]] A field description for cards.
|
||||
| [[type:style]] The styling and positioning of a field.
|
||||
| [[type:value]] The value in a field, for a particular card.
|
||||
| [[type:card]] A card containing values.
|
||||
| [[type:keyword]] A keyword.
|
||||
| [[type:font]] Description of a font.
|
||||
| [[type:symbol part]] Part of a [[type:symbol]].
|
||||
| [[type:field]] A field description for cards.
|
||||
| [[type:style]] The styling and positioning of a field.
|
||||
| [[type:value]] The value in a field, for a particular card.
|
||||
| [[type:card]] A card containing values.
|
||||
| [[type:keyword]] A keyword.
|
||||
| [[type:keyword mode]] A possible mode for keywords.
|
||||
| [[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:font]] Description of a font.
|
||||
| [[type:symbol part]] Part of a [[type:symbol]].
|
||||
| [[type:control point]] A point on in a symbol part.
|
||||
|
||||
--Collection types--
|
||||
| [[type:list]] Lists of items
|
||||
@@ -42,8 +47,18 @@ These contain several properties, similair to the file types. But they are part
|
||||
| [[type:image]] An image defined by a script.
|
||||
| [[type:function]] Functions in scripts. These have no direct representation in a file.
|
||||
|
||||
--Enumerations--
|
||||
| [[type:alignment]] Alignment of text and images
|
||||
| [[type:direction]] Direction of text
|
||||
| [[type:combine]] How to combine images with the background
|
||||
|
||||
--Primitive types--
|
||||
| [[type:string]] Text, @"abc"@
|
||||
| [[type:int]] Integer numbers, @1, 2, 100@
|
||||
| [[type:double]] Real numbers, @1, 0.5, 21.3@
|
||||
| [[type:color]] Colors
|
||||
| [[type:string]] Text, @"abc"@
|
||||
| [[type:tagged string]] Text with tags
|
||||
| [[type:filename]] Filenames
|
||||
| [[type:regex]] Regular expression strings
|
||||
| [[type:boolean]] @true@ or @false@
|
||||
| [[type:int]] Integer numbers, @1, 2, 100@
|
||||
| [[type:double]] Real numbers, @1, 0.5, 21.3@
|
||||
| [[type:version]] Version numbers
|
||||
| [[type:color]] Colors
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Primitive type: integer number
|
||||
|
||||
Integer numbers are numbers without a decimal point.
|
||||
In many cases negative numbers don't make sense, but the program never complains about them.
|
||||
|
||||
--File syntax--
|
||||
> something: 123
|
||||
|
||||
--Script syntax--
|
||||
> 123 + 456 * -1
|
||||
|
||||
--See also--
|
||||
* [[type:double]]
|
||||
@@ -21,6 +21,7 @@ The first element of a list is numbered 0, the next 1, etc.
|
||||
> list.0 # The first element of the list 'list'
|
||||
> list[0] # The same thing
|
||||
|
||||
--Functions--
|
||||
There are several functions for working with lists:
|
||||
| [[fun:position]] Find the position of an element in a list
|
||||
| [[fun:number_of_items]] Find the number of items in a list
|
||||
|
||||
+54
-78
@@ -1,85 +1,61 @@
|
||||
==Object type: Set==
|
||||
File type: Set
|
||||
|
||||
--Package--
|
||||
A set is described in a package with the <tt>.mse-set</tt> file extension,
|
||||
--Overview--
|
||||
|
||||
Sets are part of the [[file:style triangle]]:
|
||||
| Description Looks Data
|
||||
| [[type:Game]] [[type:Stylesheet]] '''Set'''
|
||||
| [[type:Field]] [[type:Style]] [[type:Value]]
|
||||
|
||||
--Package format--
|
||||
A set is described in a [[file:package]] with the <tt>.mse-set</tt> file extension,
|
||||
such a package contains a data file called <tt>set</tt>.
|
||||
|
||||
--Properties--
|
||||
| game Name of a [[type:game]] The game this set is made for.
|
||||
| stylesheet Name of a [[type:stylesheet]] The default style for drawing cards in this set.
|
||||
| set info [[type:indexmap]] of [[type:value]]s The data for the [[prop:game:set fields]] defined in the game.
|
||||
| styling [[type:indexmap]] of [[type:value]]s
|
||||
| cards [[type:list] of [[type:card]]s The cards in the set.
|
||||
! Property Type Default Description
|
||||
| '''Common to all packages''' <<< <<< <<<
|
||||
| @mse version@ [[type:version]] ''required'' Version of MSE this set is made with.
|
||||
| @short name@ [[type:string]] file name Name of this set.
|
||||
| @depends on@ [[type:list]] of [[type:dependency]]s
|
||||
Packages this package depends on.
|
||||
|
||||
| '''Specific to sets''' <<< <<< <<<
|
||||
| game Name of a [[type:game]] ''required'' The game this set is made for.
|
||||
| stylesheet Name of a [[type:stylesheet]] ''required'' The default style for drawing cards in this set.
|
||||
| set info [[type:indexmap]] of [[type:value]]s The data for the [[prop:game:set fields]] defined in the game.
|
||||
| styling [[type:map]] of [[type:indexmap]]s of [[type:value]]s
|
||||
Data for the 'extra fields' of the stylesheet.<br/>
|
||||
This is first indexed by stylesheet name, then by field name.<br/>
|
||||
Data is given not only for the set's stylesheet but also for those of cards.
|
||||
| cards [[type:list] of [[type:card]]s The cards in the set.
|
||||
| keywords [[type:list] of [[type:keyword]]s The custom keywords in the set.
|
||||
|
||||
--Example--
|
||||
|
||||
|-
|
||||
| <tt>set info:</tt>
|
||||
| Contains custom information about the set, corresponding to the <tt>set field</tt>s in the game.
|
||||
|-
|
||||
| <tt>extra set info:</tt>
|
||||
| Contains information about the set for a specific style, corresponding to the <tt>extra field</tt>s in the style. <br>
|
||||
Stored with an index for the game, see the example below.
|
||||
|-
|
||||
| <tt>card:<br>card:<br><i>...</i></tt>
|
||||
| Contains information about each card, corresponding to the <tt>card field</tt>s in the game.
|
||||
|-
|
||||
| <tt>keyword:<br>keyword:<br><i>...</i></tt>
|
||||
| Extra keywords specific to this set, in addition to those defined in the game.
|
||||
For more information see the <a href="/extending/game">game file</a>
|
||||
|}
|
||||
|
||||
The <tt>set info</tt> and <tt>card</tt>s contain a list of keys that correspond to the names fields in the game,
|
||||
For example if the game looks like:
|
||||
name: my game
|
||||
set field:
|
||||
name: copyright
|
||||
type: text
|
||||
card field:
|
||||
name: card name
|
||||
type: text
|
||||
card field:
|
||||
name: power
|
||||
type: text
|
||||
|
||||
The the set file looks like:
|
||||
game: my game
|
||||
name: my set
|
||||
set info:
|
||||
copyright: something
|
||||
extra set info:
|
||||
name-of-style:
|
||||
name-of-field: something
|
||||
card:
|
||||
card name: first card
|
||||
power: 100
|
||||
card:
|
||||
card name: second card
|
||||
power: 50
|
||||
|
||||
|
||||
The value that is stored depends on the type of field of course, in the above example the fields have <tt>type: text</tt>, so the value is just the text.
|
||||
For other types of fields the value is encoded as follows:
|
||||
{|
|
||||
! Attribute !! Description
|
||||
|-
|
||||
| <tt>text</tt>
|
||||
| The text that is stored in the field. This text can contain <a href="/extending/tags">tags</a>.
|
||||
|-
|
||||
| <tt>choice</tt>
|
||||
| One of the choices specified in the game.
|
||||
|-
|
||||
| <tt>boolean</tt>
|
||||
| One of <tt>yes</tt> or <tt>no</tt>.
|
||||
|-
|
||||
| <tt>color</tt>
|
||||
| The color is encoded as <tt>rgb(red,green,blue)</tt> where red, green and blue are numbers between 0 and 255 that indicate the color components.
|
||||
|-
|
||||
| <tt>image</tt>
|
||||
| The filename containing the image, this file must also be in the set package. It can be empty to indicate that no image is selected.
|
||||
|-
|
||||
| <tt>symbol</tt>
|
||||
| The filename containing the <a href="/extending/symbol">symbol specification</a>, this file must also be in the set package.
|
||||
It can be empty to indicate that no symbol is selected.
|
||||
|}
|
||||
If a field has the default value (calculated by the default script), then the field name and value are ommited from the set file.
|
||||
If the game looks like:
|
||||
>mse version: 0.3.4
|
||||
>name: my game
|
||||
>set field:
|
||||
> name: copyright
|
||||
> type: text
|
||||
>card field:
|
||||
> name: card name
|
||||
> type: text
|
||||
>card field:
|
||||
> name: power
|
||||
> type: text
|
||||
The the a set file would looks like:
|
||||
>mse version: 0.3.4
|
||||
>game: my game
|
||||
>name: my set
|
||||
>set info:
|
||||
> copyright: something
|
||||
>extra set info:
|
||||
> name of style:
|
||||
> name of field: something
|
||||
>card:
|
||||
> card name: first card
|
||||
> power: 100
|
||||
>card:
|
||||
> card name: second card
|
||||
> power: 50
|
||||
|
||||
+24
-1
@@ -1,5 +1,28 @@
|
||||
==Data type: character string==
|
||||
Primitive type: character string
|
||||
|
||||
A string is just a piece of text.
|
||||
|
||||
--File syntax--
|
||||
In files, strings are written just as their value:
|
||||
> string: this is some string
|
||||
The whitespace at the beginning is removed by the program.
|
||||
Multiline strings are written on a new line, indented by a TAB:
|
||||
> string:
|
||||
> This is a very long string
|
||||
> It contains a line break.
|
||||
|
||||
--Script syntax--
|
||||
In scripts, strings are written between double quotes, @"this is a string"@.
|
||||
The backslash character is used to escape values:
|
||||
! Code Represents
|
||||
| @\"@ A " character
|
||||
| @\{@ A { character
|
||||
| @\n@ A newline character (line break)
|
||||
| @\\@ A backslash
|
||||
| @\<@ An escaped < for [[type:tagged string]]s.
|
||||
|
||||
Sections between curly braces are interpreted as script code, that is concatentated with the string, for example
|
||||
> "ab{1 + 1}c" == "ab2c"
|
||||
This can be nested arbitrarily.
|
||||
|
||||
The @+@ operator concatenates strings. Numbers and most other values are automatically converted to strings when needed.
|
||||
|
||||
+39
-9
@@ -1,12 +1,42 @@
|
||||
Object type: Stylesheet
|
||||
|
||||
--Properties--
|
||||
| @game@ Name of a [[type:game]] Game this stylesheet is made for
|
||||
| @init script@ [[type:script]]
|
||||
| @card width@ [[type:double]] Width of cards in pixels
|
||||
| @card height@ [[type:double]] Height of cards in pixels
|
||||
| @card dpi@ [[type:double]] Resoltion of cards in dots-per-inch
|
||||
| @card background@ [[type:color]] Background color of cards
|
||||
| @card style@ [[type:indexmap] of [[type:style]]s Styles for the [[property:game:card fields]] defined in the game
|
||||
|
|
||||
--Overview--
|
||||
|
||||
Stylesheets are part of the [[file:style triangle]]:
|
||||
| Description Looks Data
|
||||
| [[type:Game]] '''Stylesheet''' [[type:Set]]
|
||||
| [[type:Field]] [[type:Style]] [[type:Value]]
|
||||
|
||||
Stylesheets provide the ''look and feel'' of cards.
|
||||
|
||||
--Package format--
|
||||
A stylesheet is described in a [[file:package]] with the <tt>.mse-style</tt> file extension,
|
||||
such a package contains a data file called <tt>style</tt>.
|
||||
|
||||
--Properties--
|
||||
! Property Type Default Description
|
||||
| '''Common to all packages''' <<< <<< <<<
|
||||
| @mse version@ [[type:version]] ''required'' Version of MSE this stylesheet is made for.
|
||||
| @short name@ [[type:string]] file name A short name of this stylesheet, for the 'new set' and style panel lists.
|
||||
| @full name@ [[type:string]] file name A longer name of this stylesheet.
|
||||
| @icon@ [[type:filename]] ''none'' Filename of an icon / preview for this stylesheet, for the 'new set' and style panel lists.
|
||||
| @position hint@ [[type:int]] ∞ Where to place this item in the list? Lower numbers come first.
|
||||
| @version@ [[type:version]] @0.0.0@ Version number of this package.
|
||||
| @depends on@ [[type:list]] of [[type:dependency]]s
|
||||
Packages this package depends on.
|
||||
|
||||
| '''Specific to stylesheets''' <<< <<< <<<
|
||||
| @game@ Name of a [[type:game]] ''required'' Game this stylesheet is made for
|
||||
| @card width@ [[type:double]] 100 Width of cards in pixels
|
||||
| @card height@ [[type:double]] 100 Height of cards in pixels
|
||||
| @card dpi@ [[type:double]] 96 Resoltion of cards in dots-per-inch
|
||||
| @card background@ [[type:color]] white Background color of cards
|
||||
| @init script@ [[type:script]] @;@ Script to run when this stylesheet is loaded, after the game's init script.
|
||||
| @styling fields@ [[type:list] of [[type:field]]s Fields for styling options, shown on the 'style' panel.
|
||||
| @styling style@ [[type:indexmap] of [[type:style]]s Styles for the styling fields.
|
||||
| @set info style@ [[type:indexmap] of [[type:style]]s game.default_set_style Styling for the 'set info' panel
|
||||
| @card style@ [[type:indexmap] of [[type:style]]s Styles for the card fields defined in the game
|
||||
| @extra card fields@ [[type:list] of [[type:field]]s Additional fields to add to each card.<br/>
|
||||
These fields are intended for things like lines and boxes, whose value is determined automatically.
|
||||
| @extra card style@ [[type:indexmap] of [[type:style]]s Styling for the extra card fields
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Primitive type: version number
|
||||
|
||||
--File syntax--
|
||||
A version number consists of three components, in the form "a.b.c".
|
||||
Higher numbers mean newer versions.
|
||||
|
||||
The version number can also be a date, of the form "YYYY-MM-DD"
|
||||
|
||||
--Examples--
|
||||
> version: 1.2.3
|
||||
> version: 2007-07-12
|
||||
Reference in New Issue
Block a user