Remove duplicate code (#131)

This code is duplicated 30 lines below
This commit is contained in:
GenevensiS
2025-05-11 01:22:00 +02:00
committed by GitHub
parent 26c879e865
commit 3b52ee9d08

View File

@@ -4442,43 +4442,7 @@ crown_offset_top_2 := { 0 }
crown_disabled_3 := { not is_legend(face:3) }
crown_offset_left_3 := { 0 }
crown_offset_top_3 := { 0 }
############################################################## Overlay masks
foil_mask_base_image := { "foil_mask.png" }
foil_mask_added_sections := {
output := []
pt_field := if face == 1 then card.pt else card["pt_" + face]
if pt_field != "" then output := output + ["foil_mask_pt.png"]
output
}@(face:1)
foil_mask_removed_sections := {
output := []
sh := stamp_shape(field:face)
if sh == "round" then output := output + ["foil_mask_round.png"]
else if sh == "triangle" then output := output + ["foil_mask_triangle.png"]
output
}@(face:1)
foil_mask_blended_image := {
img := foil_mask_base_image(face)
if img != "" then (
added := foil_mask_added_sections(face)
removed := foil_mask_removed_sections(face)
len_add := length(added)
len_rem := length(removed)
if(len_add > 0) then (
for i from 0 to len_add-1 do (
img := masked_blend(dark:img, light:added[i], mask:added[i]);
"dummy return"
)
)
if(len_rem > 0) then (
for i from 0 to len_rem-1 do (
img := masked_blend(light:img, dark:removed[i], mask:removed[i]);
"dummy return"
)
)
)
img
}@(face:1)
############################################################## module styling
popout_coord := {
split := split_comma(field)