From 1d02cba9556d21fa94850dade3b55a0aacae06bf Mon Sep 17 00:00:00 2001 From: onsetsu Date: Thu, 19 Sep 2024 12:35:52 +0200 Subject: [PATCH] italic styling SQUASHED: AUTO-COMMIT-src-components-widgets-ubg-card.js, --- src/components/widgets/ubg-card.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/widgets/ubg-card.js b/src/components/widgets/ubg-card.js index 7818c5b9a..58bc19f86 100644 --- a/src/components/widgets/ubg-card.js +++ b/src/components/widgets/ubg-card.js @@ -611,6 +611,9 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 printedRules = printedRules.replace(/!!(.*?)!!/gmi, function replacer(match, content) { return `${content}`; }); + printedRules = printedRules.replace(/\*(.*?)\*/gmi, (match, content) => { + return this.italic(content); + }); printedRules = this.parseEffectsAndLists(printedRules); @@ -717,11 +720,11 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 }) } + static italic(text) { + return `${text}` + } + static renderReminderText(printedRules, cardEditor, cardDesc) { - function italic(text) { - return `${text}` - } - return printedRules.replace(/\bremind(?:er)?(\w+(?:\-(\w|\(|\))*)*)\b/gmi, (match, myMatch, offset, string, groups) => { const keywords = { actionquest: () => { @@ -853,15 +856,15 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 emerge: (...args) => { if (args.includes('all')) { // keyword granted - return 'When you buy a card, you may trash a card for a discount equal to its cost.' + return 'When you buy a card: You may sacrifice a card for a discount equal to its cost.' } if (args.includes('one')) { // keyword granted - return 'When you buy the card, you may trash a card for a discount equal to its cost.' + return 'When you buy the card: You may sacrifice a card for a discount equal to its cost.' } - return 'When you buy this, you may trash a card for a discount equal to its cost.' + return 'When you buy this: You may sacrifice a card for a discount equal to its cost.' }, evoke: (cost, who) => { @@ -882,7 +885,7 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 if (who === 'one') { subject = 'the card'; } - return `Passive As a free action, you may trash ${subject} to exec its blitz effects.` + return `gear Trash ${subject} to exec its blitz effects.` }, impulse: () => { @@ -967,7 +970,7 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 }, seek: (...args) => { - return 'Reveal cards from any pile until you reveal the appropriate card(s), return the others to the game box.' + return 'Reveal cards from deck until you reveal the appropriate card(s), return the others to the game box.' }, stuncounter: (...args) => { @@ -1015,7 +1018,7 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1 return `unknown reminder text '${keyword}''`; } - return italic(`(${reminderText(...modifiers)})`); + return this.italic(`(${reminderText(...modifiers)})`); }); }