Add Json importer (#46)

add boost-json to dependencies
This commit is contained in:
GenevensiS
2025-06-21 07:53:35 +02:00
committed by GitHub
parent 128bb3867d
commit e45353af9b
27 changed files with 685 additions and 185 deletions
+1
View File
@@ -12,6 +12,7 @@ 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
| @ignore_field_not_found@ [[type:boolean]] Optional. If set to true, key/value pairs that don't correspond to a card field will be ignored instead of throwing.
--Examples--
> # Create a new card
+2 -2
View File
@@ -43,10 +43,10 @@ Fields are part of the [[file:style triangle]]:
| @card list name@ [[type:localized string]] field name Alternate name to use for the card list, for example an abbreviation.
| @card list alignment@ [[type:alignment]] @left@ Alignment of the card list column.
| @sort script@ [[type:script]] Alternate way to sort the card list when using this column to sort the list.
| @construction script@ [[type:script]] Script applied to the value given when creating a card with the new_card function.
| @import script@ [[type:script]] Script applied to the value given when creating a card with the new_card function. The script may return a map from field names to values.
For example, the pt field should not be initialized directly, since it is a combination of the power field and toughness field.
So if a value is given for pt, it must be redirected to power and toughness like so: {split := split_text(value, match:"/"); [power:split[0], toughness:split[1]]}.
The script must return a map from field names to values. Use the make_map function to dynamically create maps.
Use the make_map function to dynamically create maps.
The @type@ determines what values of this field contain:
! Type Values contain Displayed as
+1 -1
View File
@@ -33,7 +33,7 @@ Such a package contains a [[file:format|data file]] called <tt>game</tt> that ha
| @default set style@ [[type:indexmap]] of [[type:style]]s Default style for the set fields, can be overridden 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. <br/>If not set uses the @card list colors@ property of the first card field that has it.
| @construction script@ [[type:script]] Script that is applied as the last step in the creation of a card in the new_card function. Must return a map from field names to values. Use the make_map function to dynamically create maps.
| @import script@ [[type:script]] Script that is applied as the last step in the creation of a card in the new_card function. Must return a map from field names to values. Use the make_map function to dynamically create maps.
| @statistics dimensions@ [[type:list]] of [[type:statistics dimension]]s from fields Dimensions for statistics, a dimension is roughly 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 DOC_MSE_VERSION: not used since 0.3.6
Choices shown on the statistics panel. <br/>By default all statistics dimensions are used.
+1 -1
View File
@@ -61,5 +61,5 @@ To translate the MSE user interface:
* Add new keys for game, stylesheet or symbol font specific keys as described above.
* Save the file, select the new locale from Edit->Preferences.
* Restart MSE, and make sure everything looks right.
* Submit the new locale to the [[http://magicseteditor.sourceforge.net/forum/7|MSE forum].
* Submit the new locale as a pull request to the [[https://github.com/MagicSetEditorPacks/Full-Magic-Pack|Full-Magic-Pack repository].
* Maintain the locale when new versions of MSE come out. A new version may have new user interface items and therefore new keys.