forked from GithubMirrors/cardconjurer
		
	Support new collector info style
This commit is contained in:
		| @@ -562,6 +562,13 @@ | ||||
| 								<span class='checkmark'></span> | ||||
| 							</label> | ||||
| 						</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'> | ||||
| 							<h5 class='input-description padding margin-bottom'>Toggle between star (seen on foils) and dot (seen on regular cards)</h5> | ||||
| 							<div class='padding'> | ||||
|   | ||||
| @@ -102,8 +102,22 @@ async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], 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({ | ||||
| 				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}, | ||||
| @@ -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}, | ||||
| 				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 | ||||
| @@ -3294,11 +3306,15 @@ function toggleStarDot() { | ||||
| 	defaultCollector.starDot = !defaultCollector.starDot; | ||||
| 	bottomInfoEdited(); | ||||
| } | ||||
| function enableNewCollectorInfoStyle() { | ||||
| 	localStorage.setItem('enableNewCollectorStyle', document.querySelector('#enableNewCollectorStyle').checked); | ||||
| 	setBottomInfoStyle(); | ||||
| 	bottomInfoEdited(); | ||||
| } | ||||
| function enableImportCollectorInfo() { | ||||
| 	localStorage.setItem('enableImportCollectorInfo', document.querySelector('#enableImportCollectorInfo').checked); | ||||
| } | ||||
| function setAutoFrame() { | ||||
| 	localStorage.setItem('autoFrame', document.querySelector('#autoFrame').value); | ||||
| 	var value = document.querySelector('#autoFrame').value; | ||||
| 	localStorage.setItem('autoFrame', value); | ||||
|  | ||||
| @@ -3576,7 +3592,6 @@ function changeCardIndex() { | ||||
| 		setXhttp.onreadystatechange = function() { | ||||
| 			if (this.readyState == 4 && this.status == 200) { | ||||
| 				var setObject = JSON.parse(this.responseText) | ||||
| 				if (setObject.printed_size) { | ||||
| 					var number = document.querySelector('#info-number').value; | ||||
|  | ||||
| 					while (number.length < 3) { | ||||
| @@ -4089,6 +4104,11 @@ if (!localStorage.getItem('enableImportCollectorInfo')) { | ||||
| } else { | ||||
| 	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')) { | ||||
| 	localStorage.setItem('autoFrame', 'false'); | ||||
| } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Josh birnholz
					Josh birnholz