diff --git a/README.md b/README.md index 970dfff..8778c51 100644 --- a/README.md +++ b/README.md @@ -25,19 +25,19 @@ This repository obtains and reformats cards for the Leder Spotlight application. ### Products -1. Create a new file matching the product name in `content/meta-data` -1. Create a new folder in `content/card-data` (the name should match the `productName` in the `meta-data` file) -1. Create a new folder in `content/card-images` (the name should match the `productName` in the `meta-data` file) -1. Create a new folder in `content/card-symbols` (the name should match the `productName` in the `meta-data` file) -1. Add a new 512x512 PNG in `content/card-symbols/products` (the name should match the `productName` in the `meta-data` file) +1. Create a new file matching the game name in `content/meta-data` +1. Create a new folder in `content/card-data` (the name should match the `gameName` in the `meta-data` file) +1. Create a new folder in `content/card-images` (the name should match the `gameName` in the `meta-data` file) +1. Create a new folder in `content/card-symbols` (the name should match the `gameName` in the `meta-data` file) +1. Add a new 512x512 PNG in `content/card-symbols/products` (the name should match the `gameName` in the `meta-data` file) Follow the guide for adding a new locale ### Locale -1. Create a new folder in `content/card-data/{product}` for the locale (probably `en-US`) - 1. Add a `{subproduct}.yml` file here (or, as many separate files as desired - they all get concatenated together) and fill it with card data. -1. Create a new folder in `content/card-images/{product}` for the locale (probably `en-US`) +1. Create a new folder in `content/card-data/{game}` for the locale (probably `en-US`) + 1. Add a `{game}.yml` file here (or, as many separate files as desired - they all get concatenated together) and fill it with card data. +1. Create a new folder in `content/card-images/{game}` for the locale (probably `en-US`) 1. Fill this folder with the images for the cards for the game. ### Adding New Filters diff --git a/content/card-data/arcs/en-US/arcsbasegame.yml b/content/card-data/arcs/en-US/arcsbasegame.yml index 12ef65e..8ad2a8a 100644 --- a/content/card-data/arcs/en-US/arcsbasegame.yml +++ b/content/card-data/arcs/en-US/arcsbasegame.yml @@ -73,6 +73,7 @@ - id: ARCS/BC01 text: >- If you **Provoke Outrage**, keep this card. + You may spend any resources as Material. You ignore Outrage when spending Material for its Prelude action. image: BC01 name: Loyal Engineers @@ -85,6 +86,7 @@ - id: ARCS/BC02 text: >- **Manufacture (Build):** Gain 1 Material. + **Prelude:** You may discard this to gain Material up to your number of empty resource slots. If the Material supply empties, steal the Material instead. image: BC02 name: Mining Interest @@ -608,4 +610,4 @@ name: Demagogue tags: - Base - - Leader \ No newline at end of file + - Leader diff --git a/content/i18n/en-US.yml b/content/i18n/en-US.yml index 7a8fff8..408b4f6 100644 --- a/content/i18n/en-US.yml +++ b/content/i18n/en-US.yml @@ -54,11 +54,11 @@ Pages: CardNameLabel: Card Name CardNamePlaceholder: Search any card name - ProductLabel: Product - ProductPlaceholder: Select product + ProductLabel: Game + ProductPlaceholder: Select game - SubproductsLabel: Subproducts - SubproductsPlaceholder: Select subproducts + SubproductsLabel: Products + SubproductsPlaceholder: Select products TagsLabel: Tags TagsPlaceholder: Select tags @@ -139,26 +139,26 @@ Pages: Product: Name: Product Text: > - You can find cards that are associated with a certain product/game by using the `product:` operator. + You can find cards that are associated with a certain game by using the `game:` operator. Examples: - - Example: '`product:oath`' - Text: Cards that belong to the Oath product. + - Example: '`game:oath`' + Text: Cards that belong to the Oath game. - - Example: '`-product:root`' - Text: Cards that don't belong to the Root product. + - Example: '`-game:root`' + Text: Cards that don't belong to the Root game. Subproduct: - Name: Subproduct + Name: Product Text: > - You can find cards that are associated with a certain subproduct/expansion by using the `subproduct:` operator. + You can find cards that are associated with a certain product by using the `product:` operator. Examples: - - Example: '`subproduct:clockwork-1`' - Text: Cards that belong to the Clockwork 1 subproduct. + - Example: '`product:clockwork-1`' + Text: Cards that belong to the Clockwork 1 product. - - Example: '`-subproduct:exiles-partisans`' - Text: Cards that don't belong to the Exiles & Partisans subproduct. + - Example: '`-product:exiles-partisans`' + Text: Cards that don't belong to the Exiles & Partisans product. Tag: Name: Tag @@ -190,7 +190,7 @@ Pages: Sorted: Sorted by SortedName: Name SortedID: ID - SortedProduct: Product + SortedProduct: Game Asc: Asc ↑ Desc: Desc ↓ diff --git a/scripts/build-card-data.ts b/scripts/build-card-data.ts index 0ccbc72..fb828a6 100644 --- a/scripts/build-card-data.ts +++ b/scripts/build-card-data.ts @@ -10,14 +10,14 @@ fs.ensureDirSync('./dist'); const formatCard = (card) => { if ( !fs.existsSync( - `./content/card-images/${card.product}/${card.locale}/${card.image}.png`, + `./content/card-images/${card.game}/${card.locale}/${card.image}.png`, ) ) { card.locale = 'en-US'; } const baseImageName = card.image; - card.image = `https://ledercards.netlify.app/cards/${card.product}/${ + card.image = `https://ledercards.netlify.app/cards/${card.game}/${ card.locale }/${encodeURIComponent(baseImageName)}.webp`; @@ -30,12 +30,12 @@ const readAllCards = async () => { .map((f) => { const cards = yaml.load(fs.readFileSync(f)); - const [, , product, locale] = f.split(path.sep); - const subproduct = path.basename(f, '.yml'); + const [, , game, locale] = f.split(path.sep); + const product = path.basename(f, '.yml'); cards.forEach((c) => { + c.game = game; c.product = product; - c.subproduct = subproduct; c.locale = locale; }); diff --git a/scripts/build-card-images.ts b/scripts/build-card-images.ts index de931ae..3d46570 100644 --- a/scripts/build-card-images.ts +++ b/scripts/build-card-images.ts @@ -12,10 +12,10 @@ const copyAllCardImages = async () => { const productLocales = new Set(); allCardImages.forEach((f) => { - const [, , product, locale, filename] = f.split(path.sep); - filenameMapping[f] = `${product}/${locale}/${filename}`; + const [, , game, locale, filename] = f.split(path.sep); + filenameMapping[f] = `${game}/${locale}/${filename}`; - productLocales.add(`${product}/${locale}`); + productLocales.add(`${game}/${locale}`); }); productLocales.forEach((prodLocale) => { diff --git a/scripts/validate-cards.ts b/scripts/validate-cards.ts index d4d804a..0e7c196 100644 --- a/scripts/validate-cards.ts +++ b/scripts/validate-cards.ts @@ -19,8 +19,8 @@ allCards.forEach((card, index) => { process.exit(1); } - if (!card.product) { - console.error(`Card ${card.id} does not have a product.`); + if (!card.game) { + console.error(`Card ${card.id} does not have a game.`); process.exit(1); } @@ -40,8 +40,8 @@ allCards.forEach((card, index) => { 'text', 'image', 'imageClass', + 'game', 'product', - 'subproduct', 'locale', 'tags', 'meta',