From f2c57907c26d9213d4dcbe092d5a68d1952d37fd Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 26 Jun 2007 15:10:25 +0000 Subject: [PATCH] A first export template, work in progress git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@434 0fc631ac-6414-0410-93d0-97cfa31319b6 --- .../export-template | 166 ++++++++++++++++++ .../sans-serif.png | Bin 0 -> 203 bytes .../serif.png | Bin 0 -> 265 bytes .../style.css | 47 +++++ 4 files changed, 213 insertions(+) create mode 100644 data/magic-spoiler.mse-export-template/export-template create mode 100644 data/magic-spoiler.mse-export-template/sans-serif.png create mode 100644 data/magic-spoiler.mse-export-template/serif.png create mode 100644 data/magic-spoiler.mse-export-template/style.css diff --git a/data/magic-spoiler.mse-export-template/export-template b/data/magic-spoiler.mse-export-template/export-template new file mode 100644 index 00000000..f1be8805 --- /dev/null +++ b/data/magic-spoiler.mse-export-template/export-template @@ -0,0 +1,166 @@ +# Simple exporter for HTML files +mse version: 0.3.4 +game: magic +short name: Spoiler +full name: List of cards +create directory: true + +option field: + type: choice + name: grouping + description: How should cards be grouped? + choice: no grouping + choice: group by color + initial: group by color +option field: + type: choice + name: images + choice: no + choice: just the image box, linked + choice: just the image box, inline + choice: full images, linked + choice: full images, preview + choice: full images, inline + choice: full images only + initial: full images, preview +option field: + type: boolean + name: mana symbols + description: Should mana symbols be used, or should they be written as text? +option field: + type: boolean + name: rarity symbols + description: Should rarity be shown using a symbol or as text? +option field: + type: boolean + name: list keywords + description: Should the keywords be listed? +#option field: +# type: boolean +# name: fancy scripts +# description: Should fancy scripts be used +option field: + type: choice + name: font style + choice: default + choice: serif + choice: sans-serif +option field: + type: color + name: background color + initial: rgb(255,255,255) + choice: + name: white + color: rgb(255,255,255) + choice: + name: black + color: rgb(0,0,0) +option field: + type: color + name: text color + initial: rgb(0,0,0) + choice: + name: white + color: rgb(255,255,255) + choice: + name: black + color: rgb(0,0,0) + +option style: + grouping: + render style: both + choice images: + no grouping: { built_in_image("bool_no") } + group by color: /magic.mse-game/stats/card_color.png + images: + render style: both + choice images: + no: { built_in_image("bool_no") } + font style: + render style: both + choice images: + serif: /magic-spoiler.mse-export-template/serif.png + sans-serif: /magic-spoiler.mse-export-template/sans-serif.png + +script: + write_card := { + if contains(options.images, match:= "full images") then + card_image_file := write_image_file(card, file:"card{position(of:card,in:set)}.jpg") + else if contains(options.images, match:= "image box") then + card_image_file := write_image_file(card.image, file:"card{position(of:card,in:set)}.jpg") + else + card_image_file := "" + #if options.images == "full images only" + "
  • + + { to_html(card.name ) } + { to_html(card.casting_cost, symbol_font: "mana-large", symbol_size: 12 ) } + { to_html(card.type ) } + { + if options.rarity_symbols then + "{card.rarity}" + else + to_upper(card.rarity[0] or else "C") # B,C,U,R,S + } + { to_html(card.rule_text ) } + { to_html( remove_tag(tag: "", card.flavor_text) ) } + { to_html(card.pt ) } + { to_html(card.card_number ) } +
  • " + } + write_cards := { + "" + } + write_group := { + cards := filter_list(set.cards, filter: { sort_index(card:input) == code } ) + count := number_of_items(in:cards) + if count > 0 then + "

    {title} ({count} {if count == 1 then "card" else "cards"})

    " + + write_cards() + } + html := " + + + { to_html(set.title) } + + + + +

    { to_html(set.title) }

    + +
    { to_html(set.description) }
    + { if options.grouping == "group by color" then + # Codes as by sort_index + write_group(title: "White", code:"A") + + write_group(title: "Blue", code:"B") + + write_group(title: "Black", code:"C") + + write_group(title: "Red", code:"D") + + write_group(title: "Green", code:"E") + + write_group(title: "Multicolor", code:"F") + + write_group(title: "Hybrids", code:"G") + + write_group(title: "Colorless", code:"I") + + write_group(title: "Non-basic lands", code:"J") + + write_group(title: "Basic lands", code:"K") + else + write_cards(cards: set.cards) + } + + " + write_text_file(html, file:"index.html") + # make sure the urls are relative to the right directory + replace(html, match:"<[^<>]*(href|src)=\'", replace:"&{directory}/") diff --git a/data/magic-spoiler.mse-export-template/sans-serif.png b/data/magic-spoiler.mse-export-template/sans-serif.png new file mode 100644 index 0000000000000000000000000000000000000000..1046edee7c5bf552b98edfc1d7cbba35f972e5f8 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!6#=yXs@#Xw?AcwQSBeIx*f$uN~Gak=hkpdDd zag8W(&d<$F%`0JG=+x>3YGBClba4!+n3MeD|NKVA7DX0jXC~$@4lQPl-gt()TLdn# zE^C;PQDNAosxa5!w&5L5S=Ji{KI*%e|3BXJ$UaQCt%pgWfbEfx(gtxo=9Y#CM$UA{ v!)sW4V_H_sXmGn-|7FGD*T(~yPaI}A<}mMi{cFBxpq&h!u6{1-oD!M3YG7FA>EaktF(>)Q|Nr*P9L^kUZRI=~N-KCKm@qSQZ#uv( zBI+T;6R5!?p|ydFp^;r+KI@~a4u7~it}}g%kD0dTaK4HitAl}fha(UF9JL2UDjhc% zj@)0!x0mBc<_Rv91z(C)UT@m4^Py#!_KH;xSp8TX9P=g>&LlrX&M~#|JWv{_pph40JJrr>mdK II;Vst0Q(MFCIA2c literal 0 HcmV?d00001 diff --git a/data/magic-spoiler.mse-export-template/style.css b/data/magic-spoiler.mse-export-template/style.css new file mode 100644 index 00000000..bf63d1c0 --- /dev/null +++ b/data/magic-spoiler.mse-export-template/style.css @@ -0,0 +1,47 @@ +ul { + list-style: none; + margin: 0; + padding: 0; +} +.card { + margin-top: 1em; +} + +.card span { + display: block; +} + +.card .name { + font-weight: bold; + display: inline; + font-family: "Matrix"; + font-size: larger; +} +.card .casting-cost { + display: inline; + font-family: "Magic Symbols", "Magic Symbols 2004"; + font-size: larger; +} + +.card .flavor-text { + font-style: italic; +} +.card .card-number { + color: rgb(128,128,128); + font-size: smaller; +} + + +.card { + margin-top: 1.1em; + min-height: 100px; + margin-left: 90px; + position: relative; +} +.card .image { + height: 100px; + position: absolute; + left: -85px; + top: 3px; + border: none; +}