Commit b11cfe8a authored by twanvl's avatar twanvl

Fixed spoiler export template

parent cb31a811
......@@ -147,7 +147,7 @@ script:
}</ul>"
}
write_group := {
cards := filter_list(set.cards, filter: { contains(match:sort_index(card:input), code } )
cards := filter_list(set.cards, filter: { contains(color_of_card(card:input), match:code) } )
count := number_of_items(in:cards)
if count > 0 then
"<h2>{title} ({count} {if count == 1 then "card" else "cards"})</h2>" +
......@@ -204,7 +204,7 @@ script:
write_group(title: "Multicolor split cards", code:"H") +
write_group(title: "Colorless", code:"I") +
write_group(title: "Non-basic lands", code:"K") +
write_group(title: "Basic lands", code:"LMNOPQ")
write_group(title: "Basic lands", code:"L")
else
write_cards(cards: set.cards)
}
......
......@@ -170,60 +170,53 @@ init script:
############################################################## Card number
# Index for sorting, white cards are first, so white->A, blue->B, .. ,
# multi->F, hybrid->G, diff color splits -> H, arti->I, land->K, basic land->L, plains->M, island->N, swamp->O, mountain->P, forest->Q
# The code consists of 4 parts:
# normal/token, color, shifted, split
sort_index := {
(if contains(card.shape, match:"token") then "T" else "N") + # Tokens come last
color_of_card() +
(if contains(card.shape, match:"shifted") then "1" else "0") + # planeshifted cards come after normal ones
(if contains(card.shape, match:"split") then "1" else "0") # split cards come after normal ones
}
is_multicolor := { chosen(choice: "multicolor") and input != "artifact, multicolor" }
is_null_cost := { input == "" or input == "0" }
basic_land_sort := {
if contains(card.name, match:"Plains") then "LB" # Plains
else if contains(card.name, match:"Island") then "LC" # Islands
else if contains(card.name, match:"Swamp") then "LD" # Swamps
else if contains(card.name, match:"Mountain") then "LE" # Mountains
else if contains(card.name, match:"Forest") then "LF" # Forests
else "LA" # other basic lands
}
norm_or_token := {
if contains(card.shape, match:"token") then "T"
else "N"
if contains(card.name, match:"Plains") then "LB" # Plains
else if contains(card.name, match:"Island") then "LC" # Islands
else if contains(card.name, match:"Swamp") then "LD" # Swamps
else if contains(card.name, match:"Mountain") then "LE" # Mountains
else if contains(card.name, match:"Forest") then "LF" # Forests
else "LA" # other basic lands
}
color_of_card := {
card_color := card.card_color
casting_cost := card.casting_cost
if card.shape == "split" and
casting_cost != card.casting_cost_2 then "H" # Diff Color Splits
casting_cost != card.casting_cost_2 then "H" # Diff Color Splits
else if chosen(choice: "land", card_color) then (
if card.rarity != "basic land" then "K" # Nonbasic Land
if card.rarity != "basic land" then "K" # Nonbasic Land
else basic_land_sort()
) else if is_null_cost(casting_cost) then (
if chosen(choice: "hybrid", card_color) then "G" # Hybrids
else if is_multicolor(card_color) then "F" # Multicolor
else if chosen(choice:"white", card_color) then "A" # White
else if chosen(choice:"blue", card_color) then "B" # Blue
else if chosen(choice:"black", card_color) then "C" # Black
else if chosen(choice:"red", card_color) then "D" # Red
else if chosen(choice:"green", card_color) then "E" # Green
else "I" # Colorless / Artifact
if chosen(choice: "hybrid", card_color) then "G" # Hybrids
else if is_multicolor(card_color) then "F" # Multicolor
else if chosen(choice:"white", card_color) then "A" # White
else if chosen(choice:"blue", card_color) then "B" # Blue
else if chosen(choice:"black", card_color) then "C" # Black
else if chosen(choice:"red", card_color) then "D" # Red
else if chosen(choice:"green", card_color) then "E" # Green
else "I" # Colorless / Artifact
) else (
# use the casting cost
colors := sort_text(casting_cost, order: "<WUBRG>")
if colors == "" then "I" # Colorless / Artifact
else if colors == "W" then "A" # White
else if colors == "U" then "B" # Blue
else if colors == "B" then "C" # Black
else if colors == "R" then "D" # Red
else if colors == "G" then "E" # Green
else "F" # Multicolor
if colors == "" then "I" # Colorless / Artifact
else if colors == "W" then "A" # White
else if colors == "U" then "B" # Blue
else if colors == "B" then "C" # Black
else if colors == "R" then "D" # Red
else if colors == "G" then "E" # Green
else "F" # Multicolor
)
}
is_shifted := {
if contains(card.shape, match:"shifted") then "1"
else "0"
}
is_split := {
if contains(card.shape, match:"split") then "1"
else "0"
}
sort_index := { norm_or_token() + color_of_card() + is_shifted() + is_split()
}
rarity_sort := {
if set.sort_special_rarity == "with the rest" or card.rarity != "special" then "A" else "Z"
......
......@@ -73,7 +73,7 @@ The rest of the properties depend on the type of [[type:field]] this style is fo
A line height of @0@ means all lines are in the same position, @1@ is normal behaviour, @2@ skips a line, etc.
| ^^^ @line height hard@ [[type:double]] @1@ Multiplier for the line height of 'hard' line breaks. These are breaks caused by the enter key.
| ^^^ @line height line@ [[type:double]] @1@ Multiplier for the line height of 'soft' line breaks. These are breaks caused by @"<line>\n</line>"@ tags.
| ^^^ @line height soft max@ ^^^ ''disabled'' When there is still vertical room in the text box, increase the line heights to at most these values to spread the text more evenly.
| ^^^ @line height soft max@ [[type:double]] ''disabled'' When there is still vertical room in the text box, increase the line heights to at most these values to spread the text more evenly.
| ^^^ @line height hard max@ ^^^ ^^^ ^^^
| ^^^ @line height line max@ ^^^ ^^^ ^^^
| ^^^ @paragraph height@ [[type:double]] ''flexible'' The height of paragraphs. If specified, each paragraph is given this much space, and aligned inside that space as specified by @alignment@.<br/>
......@@ -86,7 +86,7 @@ The rest of the properties depend on the type of [[type:field]] this style is fo
| ^^^ @content lines@ [[type:int]] ''automatic'' When read from a script, gives the number of lines of the current content in this box.
! <<< <<< <<< <<<
| @"choice"@, @"multiple choice"@, @"boolean"@
| @"choice"@,<br/>@"multiple choice"@,<br/>@"boolean"@
@popup style@ @"drop down"@ or @"in place"@ @"drop down"@ Where to place the drop down box for editing the value.<br/>
@"drop down"@ places the box below the field, similair to normal combo boxes.<br/>
@"in place"@ places the box at the mouse coordinates.
......
......@@ -64,7 +64,9 @@ void HtmlExportWindow::onOk(wxCommandEvent&) {
info.directory_relative = fn.GetName() + _("-files");
fn.SetFullName(info.directory_relative);
info.directory_absolute = fn.GetFullPath();
wxMkdir(info.directory_absolute);
if (!wxDirExists(info.directory_absolute)) {
wxMkdir(info.directory_absolute);
}
}
// run export script
Context& ctx = set->getContext();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment