card_fields rewrite and magic-modules.mse-include (#21)
Overhauls the card_fields file to allow for template designers more freedom in manipulating data. Adds magic-modules.mse-include, a large scale include file for building templates in a standardized way. Applying this to existing frames will be coming in future updates.
This commit is contained in:
11
data/magic-modules.mse-include/rarities/card_fields
Normal file
11
data/magic-modules.mse-include/rarities/card_fields
Normal file
@@ -0,0 +1,11 @@
|
||||
card style:
|
||||
rarity:
|
||||
right: { rarity_right_1() + typeline_offset_left_1() + typeline_offset_width_1() }
|
||||
top: { rarity_top_1() + typeline_offset_top_1() }
|
||||
width: { rarity_width_1() + typeline_offset_height_1() }
|
||||
height: { rarity_height_1() + typeline_offset_height_1() }
|
||||
z index: 950
|
||||
alignment: middle right
|
||||
visible: { (not typeline_disabled_1()) and not rarity_disabled_1() }
|
||||
render style: image
|
||||
include file: /magic-modules.mse-include/rarities/choice_images
|
||||
12
data/magic-modules.mse-include/rarities/card_fields_dfc
Normal file
12
data/magic-modules.mse-include/rarities/card_fields_dfc
Normal file
@@ -0,0 +1,12 @@
|
||||
include file: /magic-modules.mse-include/rarities/card_fields
|
||||
card style:
|
||||
rarity 2:
|
||||
right: { rarity_right_2() + typeline_offset_left_2() + typeline_offset_width_2() }
|
||||
top: { rarity_top_2() + typeline_offset_top_2() }
|
||||
width: { rarity_width_2() + typeline_offset_height_2() }
|
||||
height: { rarity_height_2() + typeline_offset_height_2() }
|
||||
z index: 950
|
||||
alignment: middle center
|
||||
visible: { (not typeline_disabled_2()) and not rarity_disabled_2() }
|
||||
render style: image
|
||||
include file: /magic-modules.mse-include/rarities/choice_images
|
||||
12
data/magic-modules.mse-include/rarities/card_fields_tfc
Normal file
12
data/magic-modules.mse-include/rarities/card_fields_tfc
Normal file
@@ -0,0 +1,12 @@
|
||||
include file: /magic-modules.mse-include/rarities/card_fields_dfc
|
||||
card style:
|
||||
rarity 3:
|
||||
right: { rarity_right_3() + typeline_offset_left_3() + typeline_offset_width_3() }
|
||||
top: { rarity_top_3() + typeline_offset_top_3() }
|
||||
width: { rarity_width_3() + typeline_offset_height_3() }
|
||||
height: { rarity_height_3() + typeline_offset_height_3() }
|
||||
z index: 950
|
||||
alignment: middle center
|
||||
visible: { (not typeline_disabled_3()) and not rarity_disabled_3() }
|
||||
render style: image
|
||||
include file: /magic-modules.mse-include/rarities/choice_images
|
||||
39
data/magic-modules.mse-include/rarities/choice_images
Normal file
39
data/magic-modules.mse-include/rarities/choice_images
Normal file
@@ -0,0 +1,39 @@
|
||||
choice images:
|
||||
# Images based on the set symbol
|
||||
basic land:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("c")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else if styling.inverted_common_symbol or else set.inverted_common_symbol then symbol_variation(symbol: set.symbol, variation: "invertedcommon")
|
||||
else symbol_variation(symbol: set.symbol, variation: "common")
|
||||
common:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("c")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else if styling.inverted_common_symbol or else set.inverted_common_symbol then symbol_variation(symbol: set.symbol, variation: "invertedcommon")
|
||||
else symbol_variation(symbol: set.symbol, variation: "common")
|
||||
uncommon:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("u")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else symbol_variation(symbol: set.symbol, variation: "uncommon")
|
||||
rare:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("r")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else symbol_variation(symbol: set.symbol, variation: "rare")
|
||||
mythic rare:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("m")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else symbol_variation(symbol: set.symbol, variation: "mythic rare")
|
||||
special:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("s")
|
||||
else if alt_rarity() then alt_symbol()
|
||||
else symbol_variation(symbol: set.symbol, variation: "special")
|
||||
masterpiece:
|
||||
script:
|
||||
if use_main_rarity() then mainframe_rarity("mp")
|
||||
else symbol_variation(symbol: set.masterpiece_symbol, variation: "mythic rare")
|
||||
|
||||
49
data/magic-modules.mse-include/rarities/readme.txt
Normal file
49
data/magic-modules.mse-include/rarities/readme.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
#### Consider using the Typelines module instead of this one
|
||||
|
||||
#### To use this include in a template, add the following in the template headers:
|
||||
depends on:
|
||||
package: magic-modules.mse-include
|
||||
version: 2024-05-20
|
||||
|
||||
#### Also add this, unindented, before the card style section:
|
||||
include file: /magic-modules.mse-include/rarities/card_fields
|
||||
#### For DFC or TFC templates, instead override the faces_coordinates function, and use:
|
||||
include file: /magic-modules.mse-include/rarities/card_fields_dfc
|
||||
include file: /magic-modules.mse-include/rarities/card_fields_tfc
|
||||
|
||||
#### Also add this among the styling field section,
|
||||
#### (styling fields will appear in the order you place them):
|
||||
#### This will add a text option for customizing the colors used by the rarity symbol,
|
||||
#### and another to further tweak the positioning of the rarity symbol.
|
||||
include file: /magic-modules.mse-include/rarities/styling_fields
|
||||
|
||||
#### Default Field Placement (@375x523, w=1 h=1)
|
||||
rarity:
|
||||
left: 317w
|
||||
top: 297h
|
||||
width: 24w
|
||||
height: 24h
|
||||
#### Customization
|
||||
#### Optionally, you can define which face of the card the rarity should snap to,
|
||||
#### by defining the following function in the init script:
|
||||
typeline_face_1 := { 1 }
|
||||
|
||||
#### You can also adjust global alignment by defining the following functions, again in the init script,
|
||||
#### which must return an int corresponding to the number of pixels you want to shift the rarity by:
|
||||
|
||||
#### To shift the rarity up/down:
|
||||
rarity_offset_top_1 := { 0 }
|
||||
|
||||
#### To shift the rarity left/right:
|
||||
rarity_offset_left_1 := { 0 }
|
||||
|
||||
#### To increase/decrease the width and height of the rarity:
|
||||
rarity_offset_size_1 := { 0 }
|
||||
|
||||
#### For DFC or TFC templates, use:
|
||||
rarity_offset_top_2 := { 0 }
|
||||
rarity_offset_left_2 := { 0 }
|
||||
rarity_offset_size_2 := { 0 }
|
||||
rarity_offset_top_3 := { 0 }
|
||||
rarity_offset_left_3 := { 0 }
|
||||
rarity_offset_size_3 := { 0 }
|
||||
8
data/magic-modules.mse-include/rarities/styling_fields
Normal file
8
data/magic-modules.mse-include/rarities/styling_fields
Normal file
@@ -0,0 +1,8 @@
|
||||
styling field:
|
||||
type: text
|
||||
name: alt rarity color
|
||||
description: Use a custom color for the rarity symbol. Formatted as "R1,G1,B1:R2,G2,B2:...:X:" 1 and 2 are fill color, 3 and 4 border color, X is border thickness. For example, rare is 214,196,94:95,84,40:0,0,0:0,0,0:0.07
|
||||
styling field:
|
||||
type: text
|
||||
name: rarity offsets
|
||||
description: Formatted as "A,B,C,D". Moves the set symbol A pixels to the right, B pixels down, C pixels wider, D pixels taller. Use negatives for other directions.
|
||||
Reference in New Issue
Block a user