From fe47a30d9c8ad52564d9f6732844d319a9553549 Mon Sep 17 00:00:00 2001 From: Josh birnholz Date: Mon, 24 Apr 2023 13:08:10 -0400 Subject: [PATCH] Add collector info toggle --- creator/index.html | 7 +++++++ js/creator-23.js | 20 +++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/creator/index.html b/creator/index.html index fbecabaf..5b90937c 100644 --- a/creator/index.html +++ b/creator/index.html @@ -569,6 +569,13 @@ +
+
Show collector info
+ +
Toggle between star (seen on foils) and dot (seen on regular cards)
diff --git a/js/creator-23.js b/js/creator-23.js index f0a5544f..9167d559 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -3279,14 +3279,18 @@ async function bottomInfoEdited() { card.infoArtist = document.querySelector('#info-artist').value; card.infoYear = document.querySelector('#info-year').value; card.infoNote = document.querySelector('#info-note').value; - for (var textObject of Object.entries(card.bottomInfo)) { - if (["NOT FOR SALE", "Wizards of the Coast", "CardConjurer.com", "cardconjurer.com"].some(v => textObject[1].text.includes(v))) { + + if (document.querySelector('#enableCollectorInfo').checked) { + for (var textObject of Object.entries(card.bottomInfo)) { + if (["NOT FOR SALE", "Wizards of the Coast", "CardConjurer.com", "cardconjurer.com"].some(v => textObject[1].text.includes(v))) { + continue; + } else { + await writeText(textObject[1], bottomInfoContext); + } continue; - } else { - await writeText(textObject[1], bottomInfoContext); } - continue; } + drawCard(); } function artistEdited(value) { @@ -3311,6 +3315,9 @@ function enableNewCollectorInfoStyle() { setBottomInfoStyle(); bottomInfoEdited(); } +function enableCollectorInfo() { + localStorage.setItem('enableCollectorInfo', document.querySelector('#enableCollectorInfo').checked); + bottomInfoEdited(); function enableImportCollectorInfo() { localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked); } @@ -4135,6 +4142,9 @@ if (!localStorage.getItem('enableNewCollectorStyle')) { } else { document.querySelector('#enableNewCollectorStyle').checked = (localStorage.getItem('enableNewCollectorStyle') == 'true'); } +if (!localStorage.getItem('enableCollectorInfo')) { + localStorage.setItem('enableCollectorInfo', 'true'); +} else { if (!localStorage.getItem('autoFrame')) { localStorage.setItem('autoFrame', 'false'); } else {