DFC & Exporter Fixes

This commit is contained in:
cajun
2024-10-04 19:00:04 -05:00
parent df8497adaa
commit 647bd1c915
5 changed files with 31 additions and 19 deletions

View File

@@ -899,7 +899,9 @@ script:
#render image file
write_image :=
{
if length(card.stylesheet.card_regions) > 0 then write_multi_image()
sts := card.stylesheet
if sts == nil then sts := set.stylesheet
if length(sts.card_regions) > 0 then write_multi_image()
else write_single_image()
}
format_file_name := {

View File

@@ -673,11 +673,13 @@ write_card_images := {
height: image_export_height()
)
len := length(card.stylesheet.card_regions)
sts := card.stylesheet
if sts == nil then sts := set.stylesheet
len := length(sts.card_regions)
if len > 0 then (
card_image := to_card_image(card)
for i from 0 to len-1 do (
region_info := card.stylesheet.card_regions[i]
region_info := sts.card_regions[i]
region := crop(
card_image,
width: region_info.width,

View File

@@ -742,7 +742,9 @@ script:
+ ".jpg"
}@(fillin:"")
write_card_image := {
if length(card.stylesheet.card_regions) > 0
sts := card.stylesheet
if sts == nil then sts := set.stylesheet
if length(sts.card_regions) > 0
then write_multi_images();
write_image_file(
card,
@@ -753,9 +755,11 @@ script:
)
}
write_multi_images := {
sts := card.stylesheet
if sts == nil then sts := set.stylesheet
card_image := to_card_image(card)
for i from 0 to length(card.stylesheet.card_regions)-1 do (
region_info := card.stylesheet.card_regions[i]
for i from 0 to length(sts.card_regions)-1 do (
region_info := sts.card_regions[i]
region_name := region_info.name
fillin := if region_name == "front" or region_name == "minifront" or region_name == "meldpair"
then "a"

View File

@@ -1027,11 +1027,12 @@ init script:
styling_field := if instance <= 1 then styling.front_style else styling.back_style
if styling_field == "auto-sizing planeswalker" then (
counter := 1
bumper := 8 * (instance-1)
for x from 1 to 8 do (
tf := card["level_" + (x*instance) + "_text"]
tf := card["level_" + (x+bumper) + "_text"]
if tf != "" and tf != zwsp then counter := x;
)
tf := card["level_" + counter + "_text"]
tf := card["level_" + (counter+bumper) + "_text"]
if active then counter := counter - ( if tf == "" or tf == zwsp then 1 else 0)
else counter := counter + 1
styling_field := counter;
@@ -1524,10 +1525,6 @@ init script:
flavor_bar_disabled_1 := { mainframe_walker() or a_saga() or not set.use_flavor_bar }
flavor_bar_disabled_2 := { mainframe_walkerb() or b_saga() or not set.use_flavor_bar }
is_blank := {
input == "" or input == zwsp
}
watermark_include := "/magic-modules.mse-include/watermarks"
############################################################## Set info fields
set info style:

View File

@@ -33,7 +33,7 @@ include file: language
include file: statistics_script
include file: /magic-blends.mse-include/new-blends
############################################################## Versioning
version_date := {"2024-10-01 Template Pack 3.0.5: Magic Modules & Showcase Catchup - UBWalker fix"}
version_date := {"2024-10-01 Template Pack 3.0.5: Magic Modules & Showcase Catchup - DFC & Exporter Fixes"}
version := version_date
############################################################## Common filters
############################################################## Utility
@@ -63,6 +63,7 @@ remove_zwsp := replace@(match:"", replace:"")
#### Replace spaces by a spacer
separate_words := remove_tags + trim + replace@(match:" ", replace: {spacer})
zwsp := "" # this is a zero-width space not blank
is_blank := { input == "" or input == zwsp }
############################################################## Type
is_creature := lang_setting("is_creature")
@@ -396,14 +397,16 @@ corrected_card_number := { if exporter_num_grabber(exporter_num_filter(card.note
crop_multi_image := {
image_map := hash_new()
m3in1 := card.stylesheet.full_name == "M15 Style Meld cards (3-in-1)"
sts := card.stylesheet
if sts == nil then sts := set.stylesheet
m3in1 := sts.full_name == "M15 Style Meld cards (3-in-1)"
three_cards := false
cs := get_card_styling(card)
if m3in1 and cs.three_cards or else false then three_cards := true
card_image := to_card_image(card)
len := length(card.stylesheet.card_regions)
len := length(sts.card_regions)
for i from 0 to len-1 do (
region_info := card.stylesheet.card_regions[i]
region_info := sts.card_regions[i]
if m3in1 and three_cards and (region_info.name == "front" or region_info.name == "meldback")
then ""
else if m3in1 and (not three_cards) and (region_info.name != "front" and region_info.name != "meldback")
@@ -3560,15 +3563,19 @@ loyalty_level_is_active :=
number := to_int(replace(input, match: "lv", replace: "")) or else 999
if number > 24 then false else (
instance := if number < 9 then 1 else if number < 17 then 2 else 3
loyalty_abilities_count(active:true) >= (number mod 8))
mod_val := number mod 8
if mod_val == 0 then mod_val := 8
loyalty_abilities_count(active:true) >= mod_val
)
}
loyalty_abilities_count :=
{
styling_field := if instance <= 1 then (styling.number_of_textboxes or else "0") else (styling["number_of_textboxes_" + instance] or else "0")
if styling_field == "automatic" then (
counter := 1
bumper := 8 * (instance-1)
for x from 1 to 8 do (
tf := card["level_" + (x*instance) + "_text"]
tf := card["level_" + (x+bumper) + "_text"]
if tf != "" and tf != zwsp then counter := x;
)
tf := card["level_" + counter + "_text"]