Add extra stamps options (#60)

* add classicshifted stamps
* improve custom stamp handling and add realm acorn examples
* add split_custom_directory function so we don't have to keep copy pasting filename injection scripts
* improve to_number_lax

---------

Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com>
This commit is contained in:
GenevensiS
2024-09-17 18:53:00 +02:00
committed by GitHub
parent e77bb8ec38
commit 7833d5ad8f
86 changed files with 70 additions and 34 deletions

View File

@@ -80,7 +80,7 @@ init script:
shape := card_stamp_field(field)
if shape == "default" then shape := set.default_stamp
if shape == "custom" or shape == "flatstamped custom"
then custom_stamp(flat:not is_foil_stamped(field:field))
then custom_stamp(dimensions:dimensions, flat:not is_foil_stamped(field:field))
else "/magic-modules.mse-include/stamps/" + dimensions + " " + shape + ".png"
)
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -6,6 +6,19 @@ choice: universes beyond
choice: alchemy
choice: alchemy old
choice: custom
choice:
name: iderp classicshifted
choice: default
choice: blue
choice: gold
choice: green
choice: iblue
choice: igreen
choice: ired
choice: iwhite
choice: purple
choice: red
choice: teal
choice:
name: flatstamped
choice: standard
@@ -15,3 +28,4 @@ choice:
choice: alchemy
choice: alchemy old
choice: custom
choice: iderp classicshifted

View File

@@ -5,4 +5,5 @@ choice: heart
choice: universes beyond
choice: alchemy
choice: alchemy old
choice: iderp classicshifted
choice: custom

View File

@@ -90,12 +90,7 @@ clamp := {
}
round_up := {to_int(0.99999999999998+input)} #### 0.99999999999999 == 1, leave the 8
round_near := {to_int(0.5+input)}
to_number_lax :=
{
input := trim(input)
if input == "" or input == "-" then input := 0
to_number(input)
}
to_number_lax := { to_number(input) or else to_number(trim(input)) or else 0 }
#### reads from a comma separated list like an array
pull_comma_array := {
array := split_text(input, match:divider)
@@ -3888,6 +3883,7 @@ nameline_offset_height_3 := { 0 }
### The stamp to use if the user hasn't overwritten it for this card
card_stamp_default := {
shape := styling.default_stamp or else set.default_stamp
if shape == "iderp classicshifted" then shape := "iderp classicshifted default"
stamp_behavior := styling.stamp_behavior or else set.stamp_behavior
if stamp_behavior == "default" or stamp_behavior == "flatstamped default" then stamp_behavior := set.stamp_behavior
@@ -3909,8 +3905,13 @@ stamp_behavior_checks := [
]
### The image to use for custom stamp
custom_stamp := {
fs := split_custom_directory(set.custom_stamp_name)
if set.custom_stamp_name != "" and has_png(set.custom_stamp_name)
then "/magic-mainframe-extras.mse-include/" + un_png(set.custom_stamp_name) + (if flat then " flat" else "") + ".png"
then "/magic-mainframe-extras.mse-include/"
+ fs.directory
+ dimensions + " "
+ (if flat then "flatstamped " else "")
+ fs.filename
else "/magic-modules.mse-include/stamps/375x523 " + (if flat then "flatstamped " else "") + "heart.png"
}@(flat:false)
### The shape of the background stamp for templates
@@ -3946,8 +3947,9 @@ card_stamp_image :=
dimensions := card_stamp_possible_dimensions[dimensions] or else (if map.width > map.height then "1039x744" else "744x1039")
shape := card_stamp_field(field)
if shape == "default" then shape := set.default_stamp
if shape == "iderp classicshifted" then shape := "iderp classicshifted default"
if shape == "custom" or shape == "flatstamped custom"
then custom_stamp(flat:not is_foil_stamped(field:field))
then custom_stamp(dimensions: dimensions, flat:not is_foil_stamped(field:field))
else if shape == "none"
then ""
else "/magic-modules.mse-include/stamps/" + dimensions + " " + shape + ".png"
@@ -4584,6 +4586,11 @@ alt_symbol := {
)
}
############################################################## Other customizable stuff
split_custom_directory := {
fn := filter_text(input, match:"[^./]+.png")
dir := filter_text(input, match:"^([^.]+/)+")
[directory:dir, filename:fn]
}
custom_border_image := {
src := styling.custom_border_source or else ""
ps := split_text(src, match:"-color-")

View File

@@ -640,6 +640,7 @@ default set style:
alchemy: /magic.mse-game/stamps/alchemy.png
alchemy old: /magic.mse-game/stamps/alchemy_old.png
custom: /magic.mse-game/stamps/heart.png
iderp classicshifted: /magic.mse-game/stamps/iderp_classicshifted_default.png
stamp behavior:
render style: both
choice images:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -6,11 +6,24 @@ choice images:
universes beyond: /magic.mse-game/stamps/ub.png
alchemy: /magic.mse-game/stamps/alchemy.png
alchemy old: /magic.mse-game/stamps/alchemy_old.png
custom: { custom_stamp(flat:false) }
iderp classicshifted: /magic.mse-game/stamps/iderp_classicshifted_default.png
iderp classicshifted default: /magic.mse-game/stamps/iderp_classicshifted_default.png
iderp classicshifted blue: /magic.mse-game/stamps/iderp_classicshifted_blue.png
iderp classicshifted gold: /magic.mse-game/stamps/iderp_classicshifted_gold.png
iderp classicshifted green: /magic.mse-game/stamps/iderp_classicshifted_green.png
iderp classicshifted iblue: /magic.mse-game/stamps/iderp_classicshifted_iblue.png
iderp classicshifted igreen: /magic.mse-game/stamps/iderp_classicshifted_igreen.png
iderp classicshifted ired: /magic.mse-game/stamps/iderp_classicshifted_ired.png
iderp classicshifted iwhite: /magic.mse-game/stamps/iderp_classicshifted_iwhite.png
iderp classicshifted purple: /magic.mse-game/stamps/iderp_classicshifted_purple.png
iderp classicshifted red: /magic.mse-game/stamps/iderp_classicshifted_red.png
iderp classicshifted teal: /magic.mse-game/stamps/iderp_classicshifted_teal.png
custom: { custom_stamp(dimensions:"375x523", flat:false) }
flatstamped standard: /magic.mse-game/stamps/flat_oval.png
flatstamped acorn: /magic.mse-game/stamps/flat_acorn.png
flatstamped heart: /magic.mse-game/stamps/flat_heart.png
flatstamped universes beyond: /magic.mse-game/stamps/flat_ub.png
flatstamped alchemy: /magic.mse-game/stamps/flat_alchemy.png
flatstamped alchemy old: /magic.mse-game/stamps/flat_alchemy_old.png
flatstamped custom: { custom_stamp(flat:true) }
flatstamped custom: { custom_stamp(dimensions:"375x523", flat:true) }
flatstamped iderp classicshifted: /magic.mse-game/stamps/flat_iderp_classicshifted.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB