Bug fix for Card Symbol on DFCs
Bug fix for Amass rt
Bug fixes for "this type" capitalization
Bug fixes for CARDNAME on planes
Adds THIS atom that gets the opposite value as CARDNAME
Adds Custom Border automization
This commit is contained in:
cajun
2025-01-18 15:01:42 -06:00
parent 79765cda02
commit 64fc3828d6
10 changed files with 132 additions and 35 deletions

View File

@@ -413,8 +413,11 @@ init script:
"/magic-mainframe-extras.mse-include/" + src
}
custom_border_blend := { color_background(type:"custom_border", base_hybrid:card_hybrid, folder:"blend_masks/") }
is_custom := {contains(styling.frames, match:"custom border") and contains(styling.custom_border_source, match:".png")}
is_custom_border := {
if chosen(styling.frames, choice:"custom border")
then has_png(styling.custom_border_source)
else auto_custom_border()
}
# this goes at the very end
harder_script := [
crown: module_crown_template,
@@ -1227,7 +1230,7 @@ extra card style:
render style: image
image: { custom_border_blend() }
z index: 0
visible: {is_custom()}
visible: {is_custom_border()}
mask: {(if is_vehicle() or is_snow() or is_nyx() then "double_") + "frame_border_mask.png"}
nyx overlay:
left: 0

View File

@@ -290,9 +290,11 @@ init script:
is_leveler := {
chosen(styling.frames, choice:"leveler")
}
is_custom_border := {
chosen(styling.frames, choice:"custom border")
and contains(styling.custom_border_source, match:".png")
if chosen(styling.frames, choice:"custom border")
then has_png(styling.custom_border_source)
else auto_custom_border()
}
is_leveler := {chosen(styling.frames, choice:"leveler")}
is_legend := {

View File

@@ -499,7 +499,9 @@ init script:
)
}
front_custom_border := {
chosen(styling.other_options, choice:"custom border front") and contains(styling.custom_border_source, match:".png")
if chosen(styling.other_options, choice:"custom border front")
then has_png(styling.custom_border_source)
else auto_custom_border()
}
front_draft := {
chosen(styling.other_options, choice:"draft matters front")
@@ -552,7 +554,9 @@ init script:
)
}
back_custom_border := {
chosen(styling.other_options, choice:"custom border back")
if chosen(styling.other_options, choice:"custom border back")
then has_png(styling.custom_border_source)
else auto_custom_border_2()
}
back_draft := {
chosen(styling.other_options, choice:"draft matters back")
@@ -1525,6 +1529,12 @@ init script:
transform_symbol_offset_height_2 := {
if mainframe_walkerb() then 1 else 0
}
card_symbol_offset_top_1 := {
if front_normal() then 0 else -8
}
card_symbol_offset_top_2 := {
if front_normal() then 0 else -8
}
card_stamp_offset_top_1 := {
if mainframe_walker() and stamp_shape() == "triangle" then -3 else 0
}
@@ -1983,7 +1993,7 @@ card style:
size: { name_font_size() }
color: { name_font_color() }
name 2:
left: { if back_map() then 442 else if back_normal() then ( if card.card_symbol_2 == "none" then 435 else 455) else if card.card_symbol_2 == "none" then 456 else 439 }
left: { if back_map() then 442 else if back_normal() then ( if card.card_symbol_2 == "none" then 435 else 455) else if card.card_symbol_2 == "none" then 439 else 456 }
top: { (if back_map() then 27 else if back_normal() then 30 else 22) - 0.5*shrink_name2() }
right: { (if back_map() then 719 else 714) - card_style.casting_cost_2.content_width }
height: { 23 - (0.5 * shrink_name2()) }

View File

@@ -66,7 +66,17 @@ init script:
alt_text_script := {
combined_editor(field1:card.rule_text, separator1:"<line>\n</line>", field2:card.rule_text_2)
}
card_name_for_face := { "" }
card_name_for_face := {
if (set.CARDNAME_replacement == "card's type" xor reverse)
then (
ty := to_lower(cardname_type(card["type"]))
if ty == "" then "this"
else "this " + ty
)
else if set.CARDNAME_replacement == "card's alias" and card["alias"] != ""
then card["alias"]
else card["name"]
}@(reverse:false)
is_loaded := { card_style.text.layout.separator[0] or else 0 > 0 }
top_box_height := {

View File

@@ -66,7 +66,17 @@ init script:
alt_text_script := {
combined_editor(field1:card.rule_text, separator1:"<line>\n</line>", field2:card.rule_text_2)
}
card_name_for_face := { "" }
card_name_for_face := {
if (set.CARDNAME_replacement == "card's type" xor reverse)
then (
ty := to_lower(cardname_type(card["type"]))
if ty == "" then "this"
else "this " + ty
)
else if set.CARDNAME_replacement == "card's alias" and card["alias"] != ""
then card["alias"]
else card["name"]
}@(reverse:false)
is_loaded := { card_style.text.layout.separator[0] or else 0 > 0 }
top_box_height := {

View File

@@ -267,8 +267,9 @@ init script:
is_vehicle := {chosen(styling.other_options, choice:"vehicle")}
is_pinned := {chosen(styling.other_options, choice:"pride pinlines")}
is_custom_border := {
chosen(styling.other_options, choice:"custom border")
and contains(styling.custom_border_source, match:".png")
if chosen(styling.other_options, choice:"custom border")
then has_png(styling.custom_border_source)
else auto_custom_border()
}
custom_border_blend := { color_background(type:"custom_border", base_hybrid:card_hybrid) }

View File

@@ -229,8 +229,9 @@ init script:
else "/magic-modules.mse-include/stamps/backs/" + (if sh == "triangle" then "triangle_stamp.png" else "stamp.png")
}
is_custom_border := {
chosen(styling.frames, choice:"custom border")
and contains(styling.custom_border_source, match:".png")
if chosen(styling.frames, choice:"custom border")
then has_png(styling.custom_border_source)
else auto_custom_border()
}
custom_border_blend := { color_background(type:"custom_border", base_hybrid:card_hybrid) }
watermark_include := "/magic-modules.mse-include/watermarks"

View File

@@ -1387,7 +1387,7 @@ keyword:
keyword: Amass
match: Amass <atom-param>name</atom-param> <atom-param>number</atom-param>
mode: action
reminder: {handle_action_rt(to:"amass {param1} {param2}", "Create")} {english_number_a(param2)} +1/+1 counter(s) on an Army you control. It's also a {if param1.value == "Zombies" then "Zombie" else english_singular(param1)}. If you don't control an Army, create a 0/0 black {if param1.value == "Zombies" then "Zombie" else english_singular(param1)} Army creature token first.
reminder: {handle_action_rt(to:"amass {param1} {param2}", "Put")} {english_number_a(param2)} +1/+1 counter(s) on an Army you control. It's also a {if param1.value == "Zombies" then "Zombie" else english_singular(param1)}. If you don't control an Army, create a 0/0 black {if param1.value == "Zombies" then "Zombie" else english_singular(param1)} Army creature token first.
#Throne of Eldraine
keyword:
keyword: Adamant

View File

@@ -1675,6 +1675,12 @@ text_filter :=
in_context: "(^|[[:space:]]|\\(|,|\\.|:|“|\"|'||-|—|/|)<match>", #### TODO: Allow any punctuation before
replace: "<atom-cardname></atom-cardname>"
) +
#### step 3a : expand shortcut word THIS
replace@(
match: "THIS>?", #### >? is here so after replacement, the mouse snaps to the end of </atom>
in_context: "(^|[[:space:]]|\\(|,|\\.|:|“|\"|'||-|—|/|)<match>", #### TODO: Allow any punctuation before
replace: "<atom-printname></atom-printname>"
) +
#### step 3b : expand shortcut word LEGENDNAME
replace@(
match: "LEGENDNAME>?",
@@ -1692,18 +1698,22 @@ text_filter :=
tag: "<atom-cardname>",
contents: { "<nospellcheck>" + (if card_name=="" then "CARDNAME" else strip_card_codes(card_name, atom:true)) + "</nospellcheck>" }
) +
tag_contents@(
tag: "<atom-printname>",
contents: { "<nospellcheck>" + reverse_name_for(card_name, margin_code:margin_code) + "</nospellcheck>" }
) +
#### capitalize This type when appropriate
replace@(
match:"([•.]) <atom-cardname><nospellcheck>this",
replace:"\\1 <atom-cardname><nospellcheck>This"
match:"([•.:]) <atom-(card|print)name><nospellcheck>this",
replace:"\\1 <atom-\\2name><nospellcheck>This"
) +
replace@(
match:"([\"“'])<atom-cardname><nospellcheck>this",
replace:"\\1<atom-cardname><nospellcheck>This"
match:"([\"“'])<atom-(card|print)name><nospellcheck>this",
replace:"\\1<atom-\\2name><nospellcheck>This"
) +
replace@(
match:"^<atom-cardname><nospellcheck>this",
replace:"<atom-cardname><nospellcheck>This"
match:"^<atom-(card|print)name><nospellcheck>this",
replace:"<atom-\\2name><nospellcheck>This"
) +
tag_contents@(
tag: "<atom-legname>",
@@ -3020,19 +3030,7 @@ level_filter := { input }
#### Correct the CARDNAME atom for levelers
card_name_for_level := {
tag := name_tag_for_level()
if set.CARDNAME_replacement == "card's type"
then (
ty := to_lower(cardname_type(card["type"+tag]))
if ty == "" then "This"
else "This " + ty
)
else if set.CARDNAME_replacement == "card's alias" and card["alias"+tag] != ""
then card["alias"+tag]
else card["name"+tag]
}
card_name_for_face := {
tag := if input == 1 then "" else "_" + input
if set.CARDNAME_replacement == "card's type"
if (set.CARDNAME_replacement == "card's type" xor reverse)
then (
ty := to_lower(cardname_type(card["type"+tag]))
if ty == "" then "this"
@@ -3041,7 +3039,19 @@ card_name_for_face := {
else if set.CARDNAME_replacement == "card's alias" and card["alias"+tag] != ""
then card["alias"+tag]
else card["name"+tag]
}
}@(reverse:false)
card_name_for_face := {
tag := if input == 1 then "" else "_" + input
if (set.CARDNAME_replacement == "card's type" xor reverse)
then (
ty := to_lower(cardname_type(card["type"+tag]))
if ty == "" then "this"
else "this " + ty
)
else if set.CARDNAME_replacement == "card's alias" and card["alias"+tag] != ""
then card["alias"+tag]
else card["name"+tag]
}@(reverse:false)
cardname_type := {
if is_creature(input)
then lang_setting("creature")
@@ -3057,9 +3067,23 @@ cardname_type := {
then lang_setting("enchantment")
else if is_battle(input)
then lang_setting("battle")
else if is_plane(input)
then lang_setting("plane")
else ""
}
reverse_name_for := {
lv := "1"
face := ""
if contains(margin_code, match:"lv") then
lv := filter_text(margin_code, match:"[0-9]+")
else face := filter_text(margin_code, match:"[0-9]+")
card_name := if face != "" then card_name_for_face(face, reverse:true)
else card_name_for_level(lv, reverse:true)
if card_name == "" then "CARDNAME" else strip_card_codes(card_name, atom:true)
}
#### This can be overwritten for more complicated levelers
#### Dungeons for example will overwrite with just {""}
name_tag_for_level := {
@@ -5155,8 +5179,30 @@ split_custom_directory := {
dir := filter_text(input, match:"^([^.]+/)+")
[directory:dir, filename:fn]
}
auto_custom_available := { set.auto_custom_border != "disabled" and has_png(set.auto_custom_border_source)}
auto_custom_border := {
auto_custom_available() and active_custom_border()
}
active_custom_border := {
if set.auto_custom_border == "check typeline" then
contains(card.type, match:set.auto_custom_border_match)
else if set.auto_custom_border == "check rules text" then
contains(card.text, match:set.auto_custom_border_match)
else false
}
auto_custom_border_2 := {
auto_custom_available() and active_custom_border_2()
}
active_custom_border_2 := {
if set.auto_custom_border == "check typeline" then
contains(card.type_2, match:set.auto_custom_border_match)
else if set.auto_custom_border == "check rules text" then
contains(card.text_2, match:set.auto_custom_border_match)
else false
}
custom_border_image := {
src := styling.custom_border_source or else ""
if (not has_png(src)) and auto_custom_available() then src := set.auto_custom_border_source
ps := split_text(src, match:"-color-")
if length(ps) > 1 then
"/magic-mainframe-extras.mse-include/" + ps[0] + input + (if land then "l" else "") + ps[1]

View File

@@ -479,6 +479,20 @@ set field:
type: text
name: alternate nyx
description: Use an alternate nyx source folder from magic-mainframe-extras.mse-include.
set field:
type: choice
name: auto custom border
choice: disabled
choice: check typeline
choice: check rules text
set field:
type: text
name: auto custom border match
description: The string to match to automate a custom border.
set field:
type: text
name: auto custom border source
description: Use this file from magic-mainframe-extras as a custom vehicle-like frame. if colored, name images like "wborder.png" and put "-color-border.png" here.
set field:
type: text
name: custom index