fix custom watermark issue

a fix for better backwards compatibility made reading the size not work as well. new build_custom_watermark_blend function resolves both problems
This commit is contained in:
cajun
2024-12-22 08:36:05 -06:00
parent 2125fe9ee6
commit d8809169b6
2 changed files with 33 additions and 28 deletions

View File

@@ -1101,19 +1101,6 @@ set_watermark_blend := {
}
spotlight_watermark_blend := {
face := [1:card.card_color, 2:card.card_color_2, 3:card.card_color_3][face]
if type_of(input) == type_of("string") then (
array := split_comma(input)
input := array.0
if length(array) > 1 then (
px := px_split(array.2)
if length(px) > 2
then l := 0
else (
l := px.0
h := px.1
)
)
)
if l < 1 or h < 1 or l > 1024 or h > 1024 then (
input

View File

@@ -2417,9 +2417,9 @@ custom_watermark_link := {
array := split_comma(field)
#### not blank, has png, is either verified or old link that's probably fine
if array.0 != "" and (has_png(array.0) and array.1 or else "" != "Not found")
then "/magic-mainframe-extras.mse-include/"+array.0
then "/magic-mainframe-extras.mse-include/"+(if long then field else array.0)
else "/magic-modules.mse-include/watermarks/other/planeswalker.png"
}
}@(long:false)
card_watermark_a := {""}
custom_card_watermark := {
tag := if face == 1 then "" else "_" + face
@@ -2427,10 +2427,10 @@ custom_card_watermark := {
array := split_comma(field)
#### not blank, has png, is either verified or old link that's probably fine
if array.0 != "" and (has_png(array.0) and array.1 or else "" != "Not found")
then "/magic-mainframe-extras.mse-include/" + array.0
then "/magic-mainframe-extras.mse-include/"+(if long then field else array.0)
else if card_watermark_a() != "" then "/magic-mainframe-extras.mse-include/" + card_watermark_a()
else "/magic-modules.mse-include/watermarks/other/planeswalker.png"
}
}@(long:false)
card_new_color := {
if card.card_color == "white" then "w"
else if card.card_color == "blue" then "u"
@@ -2656,23 +2656,41 @@ watermark_scripts :=
"universes beyond ponies nightmare moon": { watermark_blend(wm_directory + "ponies/nightmare moon.png", face:face) }
"universes beyond ponies luna": { watermark_blend(wm_directory + "ponies/luna.png", face:face) }
"custom watermark one": { watermark_blend(custom_watermark_link(1), custom:true, face:face) }
"custom watermark two": { watermark_blend(custom_watermark_link(2), custom:true, face:face) }
"custom watermark three": { watermark_blend(custom_watermark_link(3), custom:true, face:face) }
"custom watermark four": { watermark_blend(custom_watermark_link(4), custom:true, face:face) }
"custom watermark five": { watermark_blend(custom_watermark_link(5), custom:true, face:face) }
"custom watermark six": { watermark_blend(custom_watermark_link(6), custom:true, face:face) }
"custom watermark seven": { watermark_blend(custom_watermark_link(7), custom:true, face:face) }
"custom watermark eight": { watermark_blend(custom_watermark_link(8), custom:true, face:face) }
"custom watermark nine": { watermark_blend(custom_watermark_link(9), custom:true, face:face) }
"custom watermark ten": { watermark_blend(custom_watermark_link(10), custom:true, face:face) }
"custom watermark card": { watermark_blend(custom_card_watermark(face:face), custom:true, face:face) }
"custom watermark one": { build_custom_watermark_blend(1) }
"custom watermark two": { build_custom_watermark_blend(2) }
"custom watermark three": { build_custom_watermark_blend(3) }
"custom watermark four": { build_custom_watermark_blend(4) }
"custom watermark five": { build_custom_watermark_blend(5) }
"custom watermark six": { build_custom_watermark_blend(6) }
"custom watermark seven": { build_custom_watermark_blend(7) }
"custom watermark eight": { build_custom_watermark_blend(8) }
"custom watermark nine": { build_custom_watermark_blend(9) }
"custom watermark ten": { build_custom_watermark_blend(10) }
"custom watermark card": { build_custom_watermark_blend("a") }
"set symbol": { if (styling.watermark_render or else set.blend_with_colors) == "glow" then glow_watermark_blend(symbol_variation(symbol: set.symbol, variation: "watermark"), face:face) else shadow_watermark_blend(symbol_variation(symbol: set.symbol, variation: "watermark"), face:face) }
]
watermark_image_1 := { watermark_scripts[card.watermark](face:watermark_face_1()) or else "" }
watermark_image_2 := { watermark_scripts[card.watermark_2](face:watermark_face_2()) or else "" }
watermark_image_3 := { watermark_scripts[card.watermark_3](face:watermark_face_3()) or else "" }
build_custom_watermark_blend := {
info := if input == "a" then custom_card_watermark(face:face, long:true)
else custom_watermark_link(input, long:true)
array := split_comma(info)
link := array.0
l := 500
h := 500
if length(array) > 1 then (
px := px_split(array.2)
if length(px) > 2
then l := 0
else (
l := px.0
h := px.1
)
)
watermark_blend(link, l:l, h:h, custom:true, face:face)
}
############################################################## Other scripted fields
#### Dimensions of card faces, can be changed in style files
faces_coordinates := {