Bump to 2 5 8 (#141)

* Bump to 2.5.8

- Hard code exception for word "plains" in english_singular and english_plural functions
- Add font preloading by TomTkacz
- Add import_image function by TomTkacz
- Fix freeze when loading a set with missing templates

* add locale entries

* include localized keywords and statistics

* Add slider fields and get_mse_path

* Allow "Default" in slider fields

* better fix for print bug

* don't draw checkerboard when image field has default

this allows an image field to be transparent before an image has been selected by the user

* allow additional individual choices in slider fields

* Add CSV / TSV importer

* Update README.md

* move game scripts to separate file

* add json import

* format english locale

* format foreign locales

* localize

* finish locales

* cleanup

* minor tweaks

* fix bug in import csv

* optimize card counts display

* tighten conditions on drop down menu closing

* widen welcome window buttons

* Update changelog.txt

* tweaks

* update cli

* add locale entries, add changelog entries

* make some values scriptable, rewrite print layout logic

* fix "referencing nonexistant file" internal error

the error would happen when an image or set symbol file was changed or deleted, then the set was saved, then the change or deletion was undone

* add add_card_to_set script function

am I crazy or was there no way to do this from the CLI?

* fix symbol font bug

* add global_script statistics dimension property

this script is ran once at the start, and its result is stored in the 'global_value' variable, which is accessible to the regular script.

with this we can get rid of the set.global_variable_average_opening_hand field, and make sure its script is ran only once, when the user clicks on the relevant statistics dimension

* Add to_json and from_json script functions

* Update changelog.txt

* bump wxWidgets to 3.3.1

* Update changelog.txt

typos and today's prs

---------

Co-authored-by: cajun <kajunkittyavenger@gmail.com>
Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com>
This commit is contained in:
GenevensiS
2025-09-23 21:53:19 +02:00
committed by GitHub
parent b81e219531
commit 240c1532ee
46 changed files with 12281 additions and 1885 deletions

View File

@@ -45,6 +45,8 @@ card field:
card field:
type: color
name: border color
alt name: bordercolor
alt name: border
description: The border of the card. Can be any solid color.
show statistics: false
card list name: Border
@@ -62,6 +64,7 @@ card field:
choice:
name: gold
color: rgb(200,180,0)
import script: dfc_split_import_script(value:value, import_script:border_import_script, margin_code:"border")
default: stylesheet; border_color_default()
card field:
@@ -288,6 +291,7 @@ card field:
card list name: Color Category
card list column: 0410
card list width: 90
import script: ""
script: remove_zwsp(color_category_statistic())
card field:
@@ -300,6 +304,7 @@ card field:
card list name: Exact Color
card list column: 0420
card list width: 100
import script: ""
script: remove_zwsp(prefixed_color_statistic())
card field:
@@ -312,6 +317,7 @@ card field:
card list name: Color Identity
card list column: 0430
card list width: 100
import script: ""
script: remove_zwsp(prefixed_color_identity_statistic())
card field:
@@ -324,6 +330,7 @@ card field:
card list name: Color Count
card list column: 0440
card list width: 40
import script: ""
script: remove_zwsp(color_count_statistic())
############################################################## Name line
@@ -368,6 +375,7 @@ card field:
pt-br: Nome 1
card list column: 0020
card list width: 150
import script: dfc_split_import_script(value:value, import_script:name_import_script, margin_code:"name1")
default: stylesheet; name_default(value, margin_code: "name1")
script: name_checker(value)
card field:
@@ -375,7 +383,6 @@ card field:
name: name 2
description: The second name of the card.
show statistics: false
identifying: true
card list name: Name 2
localized card list name:
ch-s: 名称 2
@@ -388,13 +395,13 @@ card field:
pt-br: Nome 2
card list column: 0021
card list width: 150
import script: dfc_split_import_script(value:value, import_script:name_import_script, margin_code:"name2")
default: stylesheet; name_default(value, margin_code: "name2")
card field:
type: text
name: name 3
description: The third name of the card.
show statistics: false
identifying: true
card list name: Name 3
localized card list name:
ch-s: 名称 3
@@ -407,13 +414,13 @@ card field:
pt-br: Nome 3
card list column: 0022
card list width: 150
import script: dfc_split_import_script(value:value, import_script:name_import_script, margin_code:"name3")
default: stylesheet; name_default(value, margin_code: "name3")
card field:
type: text
name: name 4
description: The fourth name of the card.
show statistics: false
identifying: true
card list name: Name 4
localized card list name:
ch-s: 名称 4
@@ -426,6 +433,7 @@ card field:
pt-br: Nome 4
card list column: 0023
card list width: 150
import script: dfc_split_import_script(value:value, import_script:name_import_script, margin_code:"name4")
default: stylesheet; name_default(value, margin_code: "name4")
card field:
@@ -465,6 +473,10 @@ card field:
card field:
type: text
name: casting cost
alt name: mana cost
alt name: manacost
alt name: cost
alt name: cc
description: The casting cost of the card.
show statistics: false
card list visible: true
@@ -480,10 +492,14 @@ card field:
card list column: 0100
card list alignment: right
card list width: 60
import script: dfc_split_import_script(value:value, import_script:cc_import_script, margin_code:"cc1")
script: mana_filter(value)
card field:
type: text
name: casting cost 2
alt name: mana cost 2
alt name: cost 2
alt name: cc 2
description: The second casting cost of the card.
show statistics: false
card list name: CC 2
@@ -498,10 +514,14 @@ card field:
card list column: 0101
card list alignment: right
card list width: 60
import script: dfc_split_import_script(value:value, import_script:cc_import_script, margin_code:"cc2")
script: mana_filter(value)
card field:
type: text
name: casting cost 3
alt name: mana cost 3
alt name: cost 3
alt name: cc 3
description: The third casting cost of the card.
show statistics: false
card list name: CC 3
@@ -516,10 +536,14 @@ card field:
card list column: 0102
card list alignment: right
card list width: 60
import script: dfc_split_import_script(value:value, import_script:cc_import_script, margin_code:"cc3")
script: mana_filter(value)
card field:
type: text
name: casting cost 4
alt name: mana cost 4
alt name: cost 4
alt name: cc 4
description: The fourth casting cost of the card.
show statistics: false
card list name: CC 4
@@ -534,6 +558,7 @@ card field:
card list column: 0103
card list alignment: right
card list width: 60
import script: dfc_split_import_script(value:value, import_script:cc_import_script, margin_code:"cc4")
script: mana_filter(value)
card field:
@@ -556,6 +581,7 @@ card field:
card list column: 0120
card list alignment: right
card list width: 40
import script: ""
script: cmc(card.casting_cost)
############################################################## Nameline symbols
@@ -666,12 +692,16 @@ card field:
card field:
type: image
name: image
alt name: illustration
alt name: art
description: The illustration of the card.
show statistics: false
card list allow: false
card field:
type: image
name: image 2
alt name: illustration 2
alt name: art 2
description: The second illustration of the card.
show statistics: false
card list allow: false
@@ -696,6 +726,7 @@ card field:
card field:
type: multiple choice
name: indicator
alt name: color indicator
description: The color indicator dot of the card. Used to indicate card color on cards without casting cost.
show statistics: false
card list name: Indicator
@@ -741,6 +772,7 @@ card field:
card field:
type: multiple choice
name: indicator 2
alt name: color indicator 2
description: The second color indicator dot of the card. Used to indicate card color on cards without casting cost.
show statistics: false
card list name: Indicator 2
@@ -786,6 +818,7 @@ card field:
card field:
type: multiple choice
name: indicator 3
alt name: color indicator 3
description: The third color indicator dot of the card. Used to indicate card color on cards without casting cost.
show statistics: false
card list name: Indicator 3
@@ -834,6 +867,7 @@ card field:
card field:
type: text
name: super type
alt name: supertype
description: The combined types and supertypes of the card.
show statistics: false
card list name: Super Type
@@ -844,6 +878,7 @@ card field:
card field:
type: text
name: super type 2
alt name: supertype 2
description: The second combined types and supertypes of the card.
show statistics: false
card list name: Super Type 2
@@ -854,6 +889,7 @@ card field:
card field:
type: text
name: super type 3
alt name: supertype 3
description: The third combined types and supertypes of the card.
show statistics: false
card list name: Super Type 3
@@ -864,6 +900,7 @@ card field:
card field:
type: text
name: super type 4
alt name: supertype 4
description: The fourth combined types and supertypes of the card.
show statistics: false
card list name: Super Type 4
@@ -877,6 +914,7 @@ card field:
card field:
type: text
name: sub type
alt name: subtype
description: The combined subtypes of the card.
show statistics: false
card list name: Sub Type
@@ -887,6 +925,7 @@ card field:
card field:
type: text
name: sub type 2
alt name: subtype 2
description: The second combined subtypes of the card.
show statistics: false
card list name: Sub Type 2
@@ -897,6 +936,7 @@ card field:
card field:
type: text
name: sub type 3
alt name: subtype 3
description: The third combined subtypes of the card.
show statistics: false
card list name: Sub Type 3
@@ -907,6 +947,7 @@ card field:
card field:
type: text
name: sub type 4
alt name: subtype 4
description: The fourth combined subtypes of the card.
show statistics: false
card list name: Sub Type 4
@@ -920,6 +961,8 @@ card field:
card field:
type: text
name: type
alt name: typeline
alt name: type line
description: The combined subtypes, types and supertypes of the card.
show statistics: false
save value: false
@@ -937,6 +980,7 @@ card field:
card list column: 0200
card list width: 220
sort script: type_sort_script(super_type: card.super_type, sub_type: card.sub_type)
import script: dfc_split_import_script(value:value, import_script:type_import_script, margin_code:"type1")
script:
combined_editor(
field1: card.super_type,
@@ -948,6 +992,8 @@ card field:
card field:
type: text
name: type 2
alt name: typeline 2
alt name: type line 2
description: The second combined subtypes, types and supertypes of the card.
show statistics: false
save value: false
@@ -964,6 +1010,7 @@ card field:
card list column: 0201
card list width: 220
sort script: type_sort_script(super_type: card.super_type_2, sub_type: card.sub_type_2)
import script: dfc_split_import_script(value:value, import_script:type_import_script, margin_code:"type2")
script:
combined_editor(
field1: card.super_type_2,
@@ -975,6 +1022,8 @@ card field:
card field:
type: text
name: type 3
alt name: typeline 3
alt name: type line 3
description: The third combined subtypes, types and supertypes of the card.
show statistics: false
save value: false
@@ -991,6 +1040,7 @@ card field:
card list column: 0202
card list width: 220
sort script: type_sort_script(super_type: card.super_type_3, sub_type: card.sub_type_3)
import script: dfc_split_import_script(value:value, import_script:type_import_script, margin_code:"type3")
script:
combined_editor(
field1: card.super_type_3,
@@ -1000,6 +1050,8 @@ card field:
card field:
type: text
name: type 4
alt name: typeline 4
alt name: type line 4
description: The fourth combined subtypes, types and supertypes of the card.
show statistics: false
save value: false
@@ -1016,6 +1068,7 @@ card field:
card list column: 0203
card list width: 220
sort script: type_sort_script(super_type: card.super_type_4, sub_type: card.sub_type_4)
import script: dfc_split_import_script(value:value, import_script:type_import_script, margin_code:"type4")
script:
combined_editor(
field1: card.super_type_4,
@@ -1053,6 +1106,7 @@ card field:
choice: special
choice: masterpiece
initial: common
import script: dfc_split_import_script(value:value, import_script:rarity_import_script, margin_code:"rarity1")
card field:
type: choice
name: rarity 2
@@ -1079,6 +1133,7 @@ card field:
choice: special
choice: masterpiece
initial: common
import script: dfc_split_import_script(value:value, import_script:rarity_import_script, margin_code:"rarity1")
default: stylesheet; card.rarity
card field:
type: choice
@@ -1106,6 +1161,7 @@ card field:
choice: special
choice: masterpiece
initial: common
import script: dfc_split_import_script(value:value, import_script:rarity_import_script, margin_code:"rarity1")
default: stylesheet; card.rarity
############################################################## The text box
@@ -1139,45 +1195,61 @@ card field:
card field:
type: text
name: rule text
alt name: rules text
alt name: rules
alt name: oracle text
description: The rules text of the card.
show statistics: false
multi line: true
card list name: Rule Text
card list column: 0700
card list width: 150
import script: text_import_script(margin_code:"text")
default: stylesheet; text_filter_default(value, card_name: card_name_for_face(1), margin_code:"text")
script: text_filter(value, card_name: card_name_for_face(1), margin_code:"text")
card field:
type: text
name: rule text 2
alt name: rules text 2
alt name: rules 2
alt name: oracle text 2
description: The second rules text of the card.
show statistics: false
multi line: true
card list name: Rule Text 2
card list column: 0701
card list width: 150
import script: text_import_script(margin_code:"text2")
default: stylesheet; text_filter_default(value, card_name: card_name_for_face(2), margin_code:"text2")
script: text_filter(value, card_name: card_name_for_face(2), margin_code:"text2")
card field:
type: text
name: rule text 3
alt name: rules text 3
alt name: rules 3
alt name: oracle text 3
description: The third rules text of the card.
show statistics: false
multi line: true
card list name: Rule Text 3
card list column: 0702
card list width: 150
import script: text_import_script(margin_code:"text3")
default: stylesheet; text_filter_default(value, card_name: card_name_for_face(3), margin_code:"text3")
script: text_filter(value, card_name: card_name_for_face(3), margin_code:"text3")
card field:
type: text
name: rule text 4
alt name: rules text 4
alt name: rules 4
alt name: oracle text 4
description: The fourth rules text of the card.
show statistics: false
multi line: true
card list name: Rule Text 4
card list column: 0703
card list width: 150
import script: text_import_script(margin_code:"text4")
default: stylesheet; text_filter_default(value, card_name: card_name_for_face(4), margin_code:"text4")
script: text_filter(value, card_name: card_name_for_face(4), margin_code:"text4")
@@ -1185,6 +1257,8 @@ card field:
card field:
type: text
name: rule text 5
alt name: rules text 5
alt name: rules 5
description: The fifth rules text of the card.
show statistics: false
multi line: true
@@ -1196,6 +1270,8 @@ card field:
card field:
type: text
name: rule text 6
alt name: rules text 6
alt name: rules 6
description: The sixth rules text of the card.
show statistics: false
multi line: true
@@ -1211,6 +1287,7 @@ card field:
card field:
type: text
name: flavor text
alt name: flavortext
description: The flavor text of the card.
show statistics: false
multi line: true
@@ -1265,6 +1342,7 @@ card field:
card list name: Text
card list column: 0740
card list width: 150
import script: text_import_script(margin_code:"text")
script:
if mainframe_walker() then
mainframe_walker_text_script()
@@ -1282,6 +1360,7 @@ card field:
card list name: Text 2
card list column: 0741
card list width: 150
import script: text_import_script(margin_code:"text2")
script:
if mainframe_walkerb() then
mainframe_walker_text_scriptb()
@@ -1299,6 +1378,7 @@ card field:
card list name: Text 3
card list column: 0742
card list width: 150
import script: text_import_script(margin_code:"text3")
script:
if mainframe_walkerc() then
mainframe_walker_text_scriptc()
@@ -1316,6 +1396,7 @@ card field:
card list name: Text 4
card list column: 0743
card list width: 150
import script: text_import_script(margin_code:"text4")
script:
if mainframe_walkerd() then
mainframe_walker_text_scriptd()
@@ -2221,6 +2302,10 @@ card field:
card field:
type: text
name: pt
alt name: p/t
alt name: p t
alt name: power/toughness
alt name: power toughness
description: The combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2237,6 +2322,7 @@ card field:
pt-br: P/R
card list column: 0300
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt1")
script:
combined_editor(
field1: card.power,
@@ -2248,6 +2334,10 @@ card field:
card field:
type: text
name: pt 2
alt name: p/t 2
alt name: p t 2
alt name: power/toughness 2
alt name: power toughness 2
description: The second combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2263,6 +2353,7 @@ card field:
pt-br: P/R 2
card list column: 0301
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt2")
script:
combined_editor(
field1: card.power_2,
@@ -2274,6 +2365,10 @@ card field:
card field:
type: text
name: pt 3
alt name: p/t 3
alt name: p t 3
alt name: power/toughness 3
alt name: power toughness 3
description: The third combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2289,6 +2384,7 @@ card field:
pt-br: P/R 3
card list column: 0302
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt3")
script:
combined_editor(
field1: card.power_3,
@@ -2300,6 +2396,10 @@ card field:
card field:
type: text
name: pt 4
alt name: p/t 4
alt name: p t 4
alt name: power/toughness 4
alt name: power toughness 4
description: The fourth combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2315,6 +2415,7 @@ card field:
pt-br: P/R 4
card list column: 0303
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt4")
script:
combined_editor(
field1: card.power_4,
@@ -2326,6 +2427,10 @@ card field:
card field:
type: text
name: pt 5
alt name: p/t 5
alt name: p t 5
alt name: power/toughness 5
alt name: power toughness 5
description: The fifth combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2341,6 +2446,7 @@ card field:
pt-br: P/R 5
card list column: 0304
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt5")
script:
combined_editor(
field1: card.power_5,
@@ -2352,6 +2458,10 @@ card field:
card field:
type: text
name: pt 6
alt name: p/t 6
alt name: p t 6
alt name: power/toughness 6
alt name: power toughness 6
description: The sixth combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2367,6 +2477,7 @@ card field:
pt-br: P/R 6
card list column: 0305
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt6")
script:
combined_editor(
field1: card.power_6,
@@ -2378,6 +2489,10 @@ card field:
card field:
type: text
name: pt 7
alt name: p/t 7
alt name: p t 7
alt name: power/toughness 7
alt name: power toughness 7
description: The seventh combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2393,6 +2508,7 @@ card field:
pt-br: P/R 7
card list column: 0306
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt7")
script:
combined_editor(
field1: card.power_7,
@@ -2404,6 +2520,10 @@ card field:
card field:
type: text
name: pt 8
alt name: p/t 8
alt name: p t 8
alt name: power/toughness 8
alt name: power toughness 8
description: The eighth combined power/toughness of the creature.
show statistics: false
save value: false
@@ -2419,6 +2539,7 @@ card field:
pt-br: P/R 8
card list column: 0307
card list width: 60
import script: dfc_split_import_script(value:value, import_script:pt_import_script, margin_code:"pt8")
script:
combined_editor(
field1: card.power_8,
@@ -2514,6 +2635,7 @@ card field:
card field:
type: choice
name: card stamp
alt name: stamp
description: The hologram security stamp of the card.
show statistics: false
card list name: Stamp
@@ -2524,6 +2646,7 @@ card field:
card field:
type: choice
name: card stamp 2
alt name: stamp 2
description: The second hologram security stamp of the card.
show statistics: false
card list name: Stamp 2
@@ -2534,6 +2657,7 @@ card field:
card field:
type: choice
name: card stamp 3
alt name: stamp 3
description: The third hologram security stamp of the card.
show statistics: false
card list name: Stamp 3
@@ -2610,6 +2734,7 @@ card field:
card field:
type: text
name: illustrator
alt name: artist
description: The illustrator of the card. Default value can be changed on the 'set info' tab. Can also be used for flavor, mechanics or template credit.
show statistics: false
card list visible: true
@@ -2620,6 +2745,7 @@ card field:
card field:
type: text
name: illustrator 2
alt name: artist 2
description: The second illustrator of the card. Default value can be changed on the 'set info' tab. Can also be used for flavor, mechanics or template credit.
show statistics: false
card list name: Artist 2
@@ -2629,6 +2755,7 @@ card field:
card field:
type: text
name: illustrator 3
alt name: artist 3
description: The third illustrator of the card. Default value can be changed on the 'set info' tab. Can also be used for flavor, mechanics or template credit.
show statistics: false
card list name: Artist 3
@@ -2845,6 +2972,7 @@ card field:
card field:
type: text
name: custom card number
alt name: collector number
description: The custom cardnumber of the card, defined by the user.
show statistics: false
card list name: Custom #
@@ -3197,6 +3325,50 @@ card field:
card list width: 50
script: custom_index()
############################################################## JSON import helper
card field:
type: text
name: card faces
description: A helper field that will import values from a Scryfall JSON card_faces object
show statistics: false
save value: false
editable: false
card list allow: false
script: ""
import script:
result := []
if value != nil then
(
count := length(value)
for f from 1 to count do
(
suffix := if f <= 1 then "" else "_" + f
map := value[f-1]
for each k:v in map do
(
if k == "oracle_text" then result := result + make_map(keys:["rule_text" + suffix], values:[v])
else if k == "flavor_text" then result := result + make_map(keys:["flavor_text" + suffix], values:[v])
else if k == "mana_cost" then result := result + make_map(keys:["casting_cost" + suffix], values:[v])
else if k == "power" then result := result + make_map(keys:["power" + suffix], values:[v])
else if k == "toughness" then result := result + make_map(keys:["toughness" + suffix], values:[v])
else if k == "defense" then result := result + make_map(keys:["loyalty" + suffix], values:[v])
else if k == "loyalty" then result := result + make_map(keys:["loyalty" + suffix], values:[v])
""
)
""
)
)
result
card field:
type: text
name: layout
description: A helper field that will import values from a Scryfall JSON layout object
show statistics: false
save value: false
editable: false
card list allow: false
############################################################## Special text
### This is given to exporters to handle complicated rules text
### In particular, things like Sagas that using styling data to determine their rules text