Support new collector info style

This commit is contained in:
Josh birnholz
2023-04-01 15:23:55 -04:00
parent 6025d9f39f
commit 011ee4deb1
2 changed files with 40 additions and 13 deletions

View File

@@ -562,6 +562,13 @@
<span class='checkmark'></span> <span class='checkmark'></span>
</label> </label>
</div> </div>
<div class='readable-background padding margin-bottom'>
<h5 class='input-description margin-bottom'>Collector info style</h5>
<label class='checkbox-container input margin-bottom'>Use new (post-ONE) collector info style
<input id='enableNewCollectorStyle' type='checkbox' onchange='enableNewCollectorInfoStyle();'>
<span class='checkmark'></span>
</label>
</div>
<div class='readable-background padding margin-bottom'> <div class='readable-background padding margin-bottom'>
<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5> <h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5>
<div class='padding'> <div class='padding'>

View File

@@ -102,8 +102,22 @@ async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers
} }
}); });
if (resetOthers) { if (resetOthers) {
//bottom info setBottomInfoStyle();
//onload
card.onload = null;
}
}
async function setBottomInfoStyle() {
if (document.querySelector('#enableNewCollectorStyle').checked) {
await loadBottomInfo({
midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
topLeft: {text:'{elemidinfo-rarity} {elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
note: {text:'{loadx}{elemidinfo-note}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
bottomLeft: {text:'NOT FOR SALE', x:0.0647, y:0.9719, width:0.8707, height:0.0143, oneLine:true, font:'gothammedium', size:0.0143, color:'white', outlineWidth:0.003},
wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003},
bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003}
});
} else {
await loadBottomInfo({ await loadBottomInfo({
midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, midLeft: {text:'{elemidinfo-set} \u2022 {elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{savex2}{elemidinfo-artist}', x:0.0647, y:0.9548, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
topLeft: {text:'{elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003}, topLeft: {text:'{elemidinfo-number}', x:0.0647, y:0.9377, width:0.8707, height:0.0171, oneLine:true, font:'gothammedium', size:0.0171, color:'white', outlineWidth:0.003},
@@ -113,8 +127,6 @@ async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers
wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003}, wizards: {name:'wizards', text:'{ptshift0,0.0172}\u2122 & \u00a9 {elemidinfo-year} Wizards of the Coast', x:0.0647, y:0.9377, width:0.8707, height:0.0167, oneLine:true, font:'mplantin', size:0.0162, color:'white', align:'right', outlineWidth:0.003},
bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003} bottomRight: {text:'{ptshift0,0.0172}CardConjurer.com', x:0.0647, y:0.9548, width:0.8707, height:0.0143, oneLine:true, font:'mplantin', size:0.0143, color:'white', align:'right', outlineWidth:0.003}
}); });
//onload
card.onload = null;
} }
} }
//Canvas management //Canvas management
@@ -3294,11 +3306,15 @@ function toggleStarDot() {
defaultCollector.starDot = !defaultCollector.starDot; defaultCollector.starDot = !defaultCollector.starDot;
bottomInfoEdited(); bottomInfoEdited();
} }
function enableNewCollectorInfoStyle() {
localStorage.setItem('enableNewCollectorStyle', document.querySelector('#enableNewCollectorStyle').checked);
setBottomInfoStyle();
bottomInfoEdited();
}
function enableImportCollectorInfo() { function enableImportCollectorInfo() {
localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked); localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked);
} }
function setAutoFrame() { function setAutoFrame() {
localStorage.setItem('autoFrame', document.querySelector('#autoFrame').value);
var value = document.querySelector('#autoFrame').value; var value = document.querySelector('#autoFrame').value;
localStorage.setItem('autoFrame', value); localStorage.setItem('autoFrame', value);
@@ -3576,7 +3592,6 @@ function changeCardIndex() {
setXhttp.onreadystatechange = function() { setXhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
var setObject = JSON.parse(this.responseText) var setObject = JSON.parse(this.responseText)
if (setObject.printed_size) {
var number = document.querySelector('#info-number').value; var number = document.querySelector('#info-number').value;
while (number.length < 3) { while (number.length < 3) {
@@ -4089,6 +4104,11 @@ if (!localStorage.getItem('enableImportCollectorInfo')) {
} else { } else {
document.querySelector('#enableImportCollectorInfo').checked = (localStorage.getItem('enableImportCollectorInfo') == 'true'); document.querySelector('#enableImportCollectorInfo').checked = (localStorage.getItem('enableImportCollectorInfo') == 'true');
} }
if (!localStorage.getItem('enableNewCollectorStyle')) {
localStorage.setItem('enableNewCollectorStyle', 'false');
} else {
document.querySelector('#enableNewCollectorStyle').checked = (localStorage.getItem('enableNewCollectorStyle') == 'true');
}
if (!localStorage.getItem('autoFrame')) { if (!localStorage.getItem('autoFrame')) {
localStorage.setItem('autoFrame', 'false'); localStorage.setItem('autoFrame', 'false');
} else { } else {