# Simple exporter for HTML files mse version: 0.3.6 game: vs short name: Spoiler full name: List of cards installer group: VS System/Export/Spoiler icon: preview.png create directory: true version: 2008-05-18 depends on: package: vs.mse-game version: 2008-01-03 ###################################################################################### option field: type: choice name: grouping description: How should cards be grouped? choice: no grouping choice: group by card type initial: no grouping option field: type: choice name: images choice: no choice: just the image box, linked choice: just the image box, inline choice: full card image, linked choice: full card image, preview choice: full card image only initial: full images, preview option field: type: boolean name: in-text symbols description: Should arrow and diamond symbols be used, or should they be written as text? #doesn't work yet: #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 card type: { built_in_image("bool_yes") } images: render style: both choice images: no: { built_in_image("bool_no") } font style: render style: both choice images: serif: /vs-spoiler.mse-export-template/serif.png sans-serif: /vs-spoiler.mse-export-template/sans-serif.png script: symbol_font := "vs-standard-arrow" symbol_font_size := 12 write_card := { if contains(options.images, match:"full card image") then card_image_file := write_image_file(card, file:"card{position(of:card,in:set)}.jpg") else if contains(options.images, match:"image box") and card.image != "" 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 card image, preview" then card_image_preview := write_image_file(card, file:"card-preview{position(of:card,in:set)}.jpg", height: 100) else card_image_preview := card_image_file if options.images == "full card image only" then "
  • " else "
  • {if options.images == "full card image, preview" then " { to_html(card.full_name ) }" else if card_image_file != "" and contains(options.images, match:"linked") then "{ to_html(card.full_name) }" else "{ to_html(card.full_name) }" }{ to_html(card.version_full ) } {if card_image_file != "" and contains(options.images, match:"inline") then "" } { to_html(card.cost ) } { to_html(card.team_full ) } { to_html(card.team_2_full ) } { to_html(card.type_text_full) } { to_html(card.symbols ) } { to_html(card.rule_text ) } { to_html( remove_tag(tag: "", card.flavor_text) ) } { to_html(card.attack) } / { to_html(card.defence) } { to_html(card.rarity ) } { to_html(card.illustrator ) } { to_html(card.number_line ) }
  • " } write_cards := { "" } write_group := { cards := filter_list(cards, filter: { contains(match: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() } copy_file("blank.gif") copy_file("blank.gif") copy_file("blank.gif") # the html page html := " { to_html(set.title) }

    { to_html(set.title) }

    { to_html(set.description) }
    { if options.grouping == "group by card type" then # Codes as by sort_index write_group(title: "Character", code:"12") + write_group(title: "Equipment", code:"3") + write_group(title: "Location", code:"4") + write_group(title: "Plot Twist", code:"5") else write_cards(cards: 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}/")