Data type: field

Data type: field

Overview

A field is a description of a kind of 'container' to hold a value.

For example the value of a 'text field' is a piece of text, that of a 'color field' a color, etc.

Things that are fields are, "card color" and "card name". Not a particular color or name, but a description of what a card color and a card name are for a particular game.

Fields are part of the style triangle:

Description Looks Data
Game Stylesheet Set
Field Style Value

Properties

Property Type Default Description
type One of:
  • text
  • choice
  • multiple choice
  • package choice
  • boolean
  • image
  • symbol
  • color
  • info
required Type of field.
name string required Name of the field.
description string "" Description of the field, shown in the status bar when the mouse is over the field.
icon filename Filename of an icon for this field, used for automatically generated statistics categories.
editable boolean true Can values of this field be edited?
save value boolean true Should values of this field be saved to files? Should be disabled for values that are generated by scripts.
show statistics boolean true Should a category be made for this field, causing it to be listed on the statistics panel?
identifying boolean false Does this field give the name of the card or set?
card list column number 0 On what position in the card list should this field be put?
card list width number 100 Width of the card list column in pixels.
card list visible boolean false Should this field be shown in the card list by default?
card list allow boolean true Should this field be allowed in the card list at all?
card list name string field name Alternate name to use for the card list, for example an abbreviation.
card list alignment alignment left Alignment of the card list column.
sort script script Alternate way to sort the card list when using this column to sort the list.
tab index number 0 Index for moving through the fields with the tab key. The default is from left to right and then top to bottom.

The type determines what values of this field contain:

Type Values contain Displayed as
text Text with markup (a tagged string) Text
choice A choice from a list Text or an image
multiple choice Zero or more choices from a list A single image or multiple images
package choice A choice from a list of installed packages Text and/or an image
boolean yes or no Text or an image or both
color Any color or a restricted selection from a list A box filled with the color
image Any image The image
symbol A symbol edited with the symbol editor The image
info An informational message, for example to group fields together. A box containing the label

Additional properties are available, depending on the type of field:

Type Property Type Default Description
"text" script script Script to apply to values of this field after each change.
If the script evaluates to a constant (i.e. doesn't use value) then values in this field can effectively not be edited.
default script Script to determine the value when it is in the default state (not edited).
default name string "Default" Name of the default state, currently not used.
multi line boolean false Can values of this field contain line breaks?
"choice" script script Script to apply to values of this field after each change.
If the script evaluates to a constant (i.e. doesn't use value) then values in this field can effectively not be edited.
default script Script to determine the value when it is in the default state (not edited).
initial string Initial value for new values for this field.
default name string "Default" Name of the default state.
choices list of choices Possible values for this field.
choice colors map of opaque colors Colors of the choices for statistics graphs.
choice colors cardlist map of opaque colors Colors of the choices for lines in the card list,
see also the card list color script property of games.
"multiple choice" Multiple choice fields have the same attributes as normal choice fields.
To refer to a combination of values in the initial attribute use choice1, choice2, choice3.
These choices must appear in the same order as they do in the choices property.
"boolean" A boolean field is a choice field with the choices "yes" and "no".
"package choice" script script Script to apply to values of this field after each change.
If the script evaluates to a constant (i.e. doesn't use value) then values in this field can effectively not be edited.
match string required Filenames of the packages to match, can include wildcards "*". For example "magic-mana-*.mse-symbol-font".
initial string required Initial package for new values for this field.
reqired boolean true Must a package always be selected? Or is it allowed to select nothing?
empty name string "None" Name of the empty state. Applies only if required: false.
"color" script script Script to apply to values of this field after each change.
If the script evaluates to a constant (i.e. doesn't use value) then values in this field can effectively not be edited.
default script Script to determine the value when it is in the default state (not edited).
initial string Initial color for new values for this field.
default name string "Default" Name of the default state.
allow custom boolean true Are colors other then those from the choices allowed?
choices list of color choices Possible values for this field.
"image" no extra properties
"symbol" no extra properties
"info" script script Script to determine the value to show.

Example

The title field gives the title of a set:

set field:
	type: text
	name: title
	identifying: true

The border color of cards can be selected from a list of choices, but other values are also possible. The default is based on a set field. Statistics don't make much sense for the border color.

card field:
	type: color
	name: border color
	default: set.border_color
	choice:
		name: black
		color: rgb(0,0,0)
	choice:
		name: white
		color: rgb(255,255,255)
	choice:
		name: silver
		color: rgb(128,128,128)
	choice:
		name: gold
		color: rgb(200,180,0)
	show statistics: false