From 2bd575c5fdfbe5911f9b47be4cbe084e1401a522 Mon Sep 17 00:00:00 2001 From: Kyle <41976328+ImKyle4815@users.noreply.github.com> Date: Mon, 17 Aug 2020 16:24:44 -0700 Subject: [PATCH] flavor text --- creator/index.html | 3 ++- data/scripts/localStorage.js | 1 + data/scripts/main.js | 13 ++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/creator/index.html b/creator/index.html index 0c8aa1e6..4006f7ee 100644 --- a/creator/index.html +++ b/creator/index.html @@ -122,6 +122,7 @@ +
X, Y, & Zoom:
@@ -141,7 +142,7 @@ - +
Remember that you must properly credit the artist before downloading your card! diff --git a/data/scripts/localStorage.js b/data/scripts/localStorage.js index 72196113..65fe2f79 100644 --- a/data/scripts/localStorage.js +++ b/data/scripts/localStorage.js @@ -118,6 +118,7 @@ function importSavedCard(localStorageKey = document.getElementById('inputCardToI document.getElementById('inputInfoSet').value = importedCard.set document.getElementById('inputInfoLanguage').value = importedCard.language document.getElementById('inputInfoArtist').value = importedCard.artist + document.getElementById('inputInfoArtist2').value = importedCard.artist bottomInfoUpdated() //Mana Cost if (importedCard.manaCostList) { diff --git a/data/scripts/main.js b/data/scripts/main.js index 5f84d460..e84c941e 100644 --- a/data/scripts/main.js +++ b/data/scripts/main.js @@ -734,6 +734,7 @@ function inputCardArtName(cardArtNameInput) { function inputCardArtNameNumber(cardArtNameNumberInput) { cardArt.src = cardArtUrlList[cardArtNameNumberInput - 1] document.getElementById('inputInfoArtist').value = cardArtArtistList[cardArtNameNumberInput - 1] + document.getElementById('inputInfoArtist2').value = document.getElementById('inputInfoArtist').value bottomInfoUpdated() } @@ -856,7 +857,11 @@ function inputCardNameNumberTextImport(index) { var importCardTextResponse = savedImportResponse[index] importText(beforeAfter(importCardTextResponse, '"name":"', '",'), 'Card Title') importText(beforeAfter(importCardTextResponse, '"type_line":"', '",'), 'Card Type') - importText(beforeAfter(importCardTextResponse, '"oracle_text":"', '",').replace(/\\n/g, '\n').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').replace(/\(/g, '{i}(').replace(/\)/g, '){/i}'), 'Rules Text') + var flavorText = '{flavor}' + beforeAfter(importCardTextResponse, '"flavor_text":"', '","') + if (flavorText.length < 10) { + flavorText = '' + } + importText((beforeAfter(importCardTextResponse, '"oracle_text":"', '",') + flavorText).replace(/\n\\"/g, '\n\u201C').replace(/{flavor}\\"/g, '{flavor}\u201C').replace(/\\n/g, '\n').replace(/ \\"/g, ' \u201C').replace(/\\"/g, '\u201D').replace(/\(/g, '{i}(').replace(/\)/g, '){/i}'), 'Rules Text') if (importCardTextResponse.includes('"power":"')) { importText(beforeAfter(importCardTextResponse, '"power":"', '",') + '/' + beforeAfter(importCardTextResponse, '"toughness":"', '",'), 'Power/Toughness') } else { @@ -1011,6 +1016,12 @@ function notify(message, color) { ` }//notify('MessageGoesHere', '#aaffaadd') +function artistNameUpdated(artistName) { + document.getElementById('inputInfoArtist').value = artistName + document.getElementById('inputInfoArtist2').value = artistName + bottomInfoUpdated() +} + //Must run last: initialize()