forked from GithubMirrors/cardconjurer
		
	various improvements
This commit is contained in:
		| @@ -57,6 +57,7 @@ var scryfallArt; | ||||
| var scryfallCard; | ||||
| //for text | ||||
| var savedTextXPosition = 0; | ||||
| var savedTextContents = {}; | ||||
| //for misc | ||||
| var date = new Date(); | ||||
| const year = 'WOW' //date.getFullYear(); | ||||
| @@ -532,7 +533,6 @@ function frameElementClicked(event) { | ||||
| function frameElementMaskRemoved() { | ||||
| 	const selectElement = document.querySelector('#frame-editor-masks'); | ||||
| 	const selectedOption = selectElement.value; | ||||
| 	console.log(selectedOption) | ||||
| 	if (selectedOption != 'None Selected') { | ||||
| 		selectElement.remove(selectElement.selectedIndex); | ||||
| 		selectElement.selectedIndex = 0; | ||||
| @@ -561,6 +561,9 @@ function uploadFrameOption(imageSource) { | ||||
| var writingText; | ||||
| function loadTextOptions(textObject, replace=true) { | ||||
| 	var oldCardText = card.text || {}; | ||||
| 	Object.entries(oldCardText).forEach(item => { | ||||
| 		savedTextContents[item[0]] = oldCardText[item[0]].text; | ||||
| 	}); | ||||
| 	if (replace) { | ||||
| 		card.text = textObject; | ||||
| 	} else { | ||||
| @@ -572,6 +575,8 @@ function loadTextOptions(textObject, replace=true) { | ||||
| 	Object.entries(card.text).forEach(item => { | ||||
| 		if (oldCardText[item[0]]) { | ||||
| 			card.text[item[0]].text = oldCardText[item[0]].text; | ||||
| 		} else if (savedTextContents[item[0]]) { | ||||
| 			card.text[item[0]].text = savedTextContents[item[0]]; | ||||
| 		} | ||||
| 		var textOptionElement = document.createElement('h4'); | ||||
| 		textOptionElement.innerHTML = item[1].name; | ||||
| @@ -651,9 +656,7 @@ function writeText(textObject, targetContext) { | ||||
| 			} else { | ||||
| 				item.split('').forEach(char => { | ||||
| 					if (char == '’') { | ||||
| 						console.log(char); | ||||
| 						newSplitText.push(`{right${startingTextSize * 0.6}}`, '’', '{lns}', `{up${startingTextSize * 0.75}}`); | ||||
| 						console.log(newSplitText); | ||||
| 					} else { | ||||
| 						newSplitText.push(char, '{lns}'); | ||||
| 					} | ||||
| @@ -1662,7 +1665,6 @@ function loadScript(scriptPath) { | ||||
| } | ||||
| // Stretchable SVGs | ||||
| function stretchSVG(frameObject) { | ||||
| 	// console.log(frameObject); | ||||
| 	xhr = new XMLHttpRequest(); | ||||
| 	xhr.open('GET', fixUri(frameObject.src), true); | ||||
| 	xhr.overrideMimeType('image/svg+xml'); | ||||
|   | ||||
| @@ -10,5 +10,7 @@ loadFramePacks([ | ||||
| 	{name:'Inner Crowns', value:'M15InnerCrowns'}, | ||||
| 	{name:'Holo Stamps', value:'M15HoloStamps'}, | ||||
| 	{name:'Dark Power/Toughness', value:'M15DarkPT'}, | ||||
| 	{name:'Colored Borders', value:'M15Borders'} | ||||
| 	{name:'Colored Borders', value:'M15Borders'}, | ||||
| 	{name:'Custom Addons', value:'disabled'}, | ||||
| 	{name:'Brawl Legend Crowns', value:'Brawl'} | ||||
| ]) | ||||
| @@ -4,6 +4,8 @@ loadFramePacks([ | ||||
| 	{name:'Legend Crowns', value:'M15LegendCrowns'}, | ||||
| 	{name:'Inner Crowns', value:'M15InnerCrowns'}, | ||||
| 	{name:'Holo Stamps', value:'M15HoloStamps'}, | ||||
| 	{name:'Colored Borders', value:'M15Borders'} | ||||
| 	{name:'Colored Borders', value:'M15Borders'}, | ||||
| 	{name:'Custom Addons', value:'disabled'}, | ||||
| 	{name:'Brawl Legend Crowns', value:'Brawl'} | ||||
| ]) | ||||
| notify('When you load the Saga frame version, a "Saga" tab will appear. This tab controls the placement and chapter counts for Saga chapters.') | ||||
| @@ -12,5 +12,7 @@ loadFramePacks([ | ||||
| 	{name:'Inner Crowns', value:'M15InnerCrowns'}, | ||||
| 	{name:'Holo Stamps', value:'M15HoloStamps'}, | ||||
| 	{name:'Dark Power/Toughness', value:'M15DarkPT'}, | ||||
| 	{name:'Colored Borders', value:'M15Borders'} | ||||
| 	{name:'Colored Borders', value:'M15Borders'}, | ||||
| 	{name:'Custom Addons', value:'disabled'}, | ||||
| 	{name:'Brawl Legend Crowns', value:'Brawl'} | ||||
| ]) | ||||
| @@ -8,5 +8,7 @@ loadFramePacks([ | ||||
| 	{name:'Inner Crowns', value:'M15InnerCrowns'}, | ||||
| 	{name:'Holo Stamps', value:'M15HoloStamps'}, | ||||
| 	{name:'Dark Power/Toughness', value:'M15DarkPT'}, | ||||
| 	{name:'Colored Borders', value:'M15Borders'} | ||||
| 	{name:'Colored Borders', value:'M15Borders'}, | ||||
| 	{name:'Custom Addons', value:'disabled'}, | ||||
| 	{name:'Brawl Legend Crowns', value:'Brawl'} | ||||
| ]) | ||||
| @@ -34,7 +34,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() { | ||||
| 	//sets card version | ||||
| 	card.version = 'futureRegular'; | ||||
| 	loadScript('/js/frames/manaSymbolsFuture.js'); | ||||
| 	notify('The Future version adds special mana symbols. To use them, place an "F" before the following mana symbols: wubrg, 0-20, x, and hybrid mana symbols.'); | ||||
| 	// notify('The Future version adds special mana symbols. To use them, place an "F" before the following mana symbols: wubrg, 0-20, x, and hybrid mana symbols.'); | ||||
| 	//art bounds | ||||
| 	card.artBounds = {x:0.086, y:0.0843, width:0.8714, height:0.5853}; | ||||
| 	autoFitArt(); | ||||
| @@ -46,7 +46,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() { | ||||
| 	resetWatermark(); | ||||
| 	//text | ||||
| 	loadTextOptions({ | ||||
| 		mana: {name:'Mana Cost', text:'', size:119/1638, manaCost:true, manaPlacement:{x:[0.1224, 0.082, 0.0619, 0.0619, 0.0794, 0.1425], y:[0.1348, 0.1993, 0.2705, 0.3427, 0.4206, 0.4928]}, noVerticalCenter:true}, | ||||
| 		mana: {name:'Mana Cost', text:'', size:119/1638, manaCost:true, manaPlacement:{x:[0.1224, 0.082, 0.0619, 0.0619, 0.0794, 0.1425], y:[0.1348, 0.1993, 0.2705, 0.3427, 0.4206, 0.4928]}, noVerticalCenter:true, manaPrefix:'f'}, | ||||
| 		title: {name:'Title', text:'', x:0.176, y:0.0491, width:0.832, height:0.0643, oneLine:true, font:'matrixb', size:0.0448, color:'white'}, | ||||
| 		type: {name:'Type', text:'', x:0.1214, y:0.5615, width:0.832, height:0.0586, oneLine:true, font:'matrixb', size:0.0362, color:'white'}, | ||||
| 		rules: {name:'Rules Text', text:'', x:0.1027, y:0.6248, width:0.8074, height:0.2639, size:0.0362}, | ||||
|   | ||||
| @@ -29,7 +29,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() { | ||||
| 	//sets card version | ||||
| 	card.version = 'm21'; | ||||
| 	loadScript('/js/frames/manaSymbolsM21.js'); | ||||
| 	notify('The M21 version adds special mana symbols. To use them, place an "M21" or "DM21" before the following mana symbols: wubrg, 0-9, and x.'); | ||||
| 	notify('To use the darker mana symbols on white cards, place a "DM21" (for "Dark M21") before the following mana symbols: wubrg, 0-9, and x.'); | ||||
| 	//art bounds | ||||
| 	card.artBounds = {x:0.0767, y:0.1129, width:0.8476, height:0.4429}; | ||||
| 	autoFitArt(); | ||||
| @@ -41,7 +41,7 @@ document.querySelector('#loadFrameVersion').onclick = async function() { | ||||
| 	resetWatermark(); | ||||
| 	//text | ||||
| 	loadTextOptions({ | ||||
| 		mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', manaCost:true, manaSpacing:0}, | ||||
| 		mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', manaCost:true, manaSpacing:0, manaPrefix:'m21'}, | ||||
| 		title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, color:'white', shadowX:0.0014, shadowY:0.001}, | ||||
| 		type: {name:'Type', text:'', x:0.0854, y:0.5664, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324, color:'white', shadowX:0.0014, shadowY:0.001}, | ||||
| 		rules: {name:'Rules Text', text:'', x:0.0967, y:0.6453, width:0.8067, height:0.2381, size:0.0362}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kyle
					Kyle