fixes
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameA.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameB.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameG.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameL.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameM.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameR.png
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameU.png
Normal file
After Width: | Height: | Size: 825 KiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameV.png
Normal file
After Width: | Height: | Size: 999 KiB |
BIN
data/images/cardImages/m15/boxTopper/m15BoxTopperFrameW.png
Normal file
After Width: | Height: | Size: 1009 KiB |
BIN
data/images/cardImages/m15/m21/m15M21Fire.png
Normal file
After Width: | Height: | Size: 522 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 49 KiB |
@@ -61,6 +61,17 @@ function importSavedCard(localStorageKey = document.getElementById('inputCardToI
|
||||
if (localStorageKey) {
|
||||
selectedCardKey = localStorageKey
|
||||
importedCard = JSON.parse(localStorage.getItem(localStorageKey))
|
||||
//Skip trackers
|
||||
skipLoadTextList = 0
|
||||
skipResizeCardArt = 1
|
||||
if (importedCard.version != currentVersion) {
|
||||
skipLoadTextList += 1
|
||||
skipResizeCardArt += 1
|
||||
if (importedCard.version.split('/')[1] != 'version') {
|
||||
skipLoadTextList += 1
|
||||
skipResizeCardArt += 1
|
||||
}
|
||||
}
|
||||
//Masks
|
||||
loadMaskImages(importedCard.maskList)
|
||||
//Version
|
||||
@@ -87,13 +98,10 @@ function importSavedCard(localStorageKey = document.getElementById('inputCardToI
|
||||
}
|
||||
uniqueNumberTracker = importedCard.numberTracker
|
||||
//Art
|
||||
document.getElementById('inputCardArtX').value = importedCard.artX
|
||||
document.getElementById('inputCardArtY').value = importedCard.artY
|
||||
document.getElementById('inputCardArtZoom').value = importedCard.artZoom
|
||||
cardArt.src = importedCard.cardArt
|
||||
setTimeout(function() {
|
||||
document.getElementById('inputCardArtX').value = importedCard.artX
|
||||
document.getElementById('inputCardArtY').value = importedCard.artY
|
||||
document.getElementById('inputCardArtZoom').value = importedCard.artZoom
|
||||
cardArtUpdated()
|
||||
}, 500) //These are delayed to not get written over by the image loading
|
||||
//Set Symbol
|
||||
setSymbol.src = importedCard.setSymbol
|
||||
document.getElementById('inputSetSymbolX').value = importedCard.setSymbolX
|
||||
@@ -111,14 +119,23 @@ function importSavedCard(localStorageKey = document.getElementById('inputCardToI
|
||||
document.getElementById('inputInfoLanguage').value = importedCard.language
|
||||
document.getElementById('inputInfoArtist').value = importedCard.artist
|
||||
bottomInfoUpdated()
|
||||
//Text
|
||||
//Mana Cost
|
||||
if (importedCard.manaCostList) {
|
||||
for (var i = 0; i < importedCard.manaCostList.length; i ++) {
|
||||
if (!manaSymbolCodeList.includes(importedCard.manaCostList[i][0])) {
|
||||
manaSymbolCodeList.push(importedCard.manaCostList[i][0])
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].onload = manaCostUpdated
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = importedCard.manaCostList[i][1]
|
||||
}
|
||||
}
|
||||
}
|
||||
document.getElementById('inputManaCost').value = importedCard.manaCost
|
||||
manaCostUpdated()
|
||||
setTimeout(function() {
|
||||
cardTextList = importedCard.text
|
||||
document.getElementById('textPicker').children[0].click()
|
||||
drawCardText()
|
||||
}, 500)
|
||||
//Text
|
||||
cardTextList = importedCard.text
|
||||
document.getElementById('textPicker').children[0].click()
|
||||
drawCardText()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +175,13 @@ class savedCard {
|
||||
this.set = document.getElementById('inputInfoSet').value
|
||||
this.language = document.getElementById('inputInfoLanguage').value
|
||||
this.artist = document.getElementById('inputInfoArtist').value
|
||||
//Text
|
||||
//Mana Cost
|
||||
this.manaCostList = []
|
||||
for (var i = 0; i < usedManaSymbols.length; i ++) {
|
||||
this.manaCostList.push([usedManaSymbols[i], manaSymbolImageList[manaSymbolCodeList.indexOf(usedManaSymbols[i])].src])
|
||||
}
|
||||
this.manaCost = document.getElementById('inputManaCost').value
|
||||
//Text
|
||||
this.text = cardTextList
|
||||
//Key
|
||||
this.key = keyToUse
|
||||
|
@@ -16,20 +16,25 @@ var cardTextList = new Array()
|
||||
var manaSymbolCodeList = []
|
||||
var manaSymbolImageList = []
|
||||
var deletingCardObject = false
|
||||
var skipResizeCardArt = 0
|
||||
var skipLoadTextList = 0
|
||||
var usedManaSymbols = []
|
||||
date = new Date()
|
||||
var cornerCutout = new Image()
|
||||
cornerCutout.src = '/data/images/cardImages/cornerCutout.png'
|
||||
|
||||
function addToManaSymbolList(folderPath, newManaSymbolList) {
|
||||
for (var i = 0; i < newManaSymbolList.length; i ++) {
|
||||
if (newManaSymbolList[i].includes('.svg')) {
|
||||
manaSymbolCodeList.push(newManaSymbolList[i].replace('.svg', ''))
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = folderPath + newManaSymbolList[i]
|
||||
} else {
|
||||
manaSymbolCodeList.push(newManaSymbolList[i])
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = folderPath + newManaSymbolList[i] + '.png'
|
||||
if (!manaSymbolCodeList.includes(newManaSymbolList[i].replace('.svg', ''))) {
|
||||
if (newManaSymbolList[i].includes('.svg')) {
|
||||
manaSymbolCodeList.push(newManaSymbolList[i].replace('.svg', ''))
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = folderPath + newManaSymbolList[i]
|
||||
} else {
|
||||
manaSymbolCodeList.push(newManaSymbolList[i])
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = folderPath + newManaSymbolList[i] + '.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,13 +83,17 @@ watermark.crossOrigin = "anonymous"
|
||||
cardArt.onload = function() {
|
||||
cardMasterList[0].width = this.width / cardWidth
|
||||
cardMasterList[0].height = this.height / cardHeight
|
||||
if (this.width / this.height > artWidth / artHeight) {
|
||||
document.getElementById('inputCardArtZoom').value = artHeight / this.height * 100
|
||||
} else {
|
||||
document.getElementById('inputCardArtZoom').value = artWidth / this.width * 100
|
||||
}
|
||||
document.getElementById('inputCardArtX').value = artX
|
||||
document.getElementById('inputCardArtY').value = artY
|
||||
if (skipResizeCardArt < 1) {
|
||||
if (this.width / this.height > artWidth / artHeight) {
|
||||
document.getElementById('inputCardArtZoom').value = artHeight / this.height * 100
|
||||
} else {
|
||||
document.getElementById('inputCardArtZoom').value = artWidth / this.width * 100
|
||||
}
|
||||
document.getElementById('inputCardArtX').value = artX
|
||||
document.getElementById('inputCardArtY').value = artY
|
||||
} else {
|
||||
skipResizeCardArt -= 1
|
||||
}
|
||||
cardArtUpdated()
|
||||
}
|
||||
function setSymbolFromGatherer() {
|
||||
@@ -419,10 +428,12 @@ function getFloat(input) {
|
||||
function loadTextOptions(textArray = []) {
|
||||
document.getElementById('textPicker').innerHTML = ''
|
||||
var backupTextValues = cardTextList
|
||||
cardTextList = textArray
|
||||
if (skipLoadTextList < 1) {
|
||||
cardTextList = textArray
|
||||
}
|
||||
for (var i = 0; i < cardTextList.length; i++) {
|
||||
for (var n = 0; n < backupTextValues.length; n++) {
|
||||
if (cardTextList[i].name == backupTextValues[n].name) {
|
||||
if (cardTextList[i].name == backupTextValues[n].name && skipLoadTextList < 1) {
|
||||
cardTextList[i].text = backupTextValues[n].text
|
||||
}
|
||||
}
|
||||
@@ -431,10 +442,15 @@ function loadTextOptions(textArray = []) {
|
||||
document.getElementById('textPicker').children[0].click()
|
||||
cardTextEdited()
|
||||
if (setSymbol.src != '') {
|
||||
setSymbol.src = setSymbol.src
|
||||
setSymbol.onload()
|
||||
}
|
||||
if (cardArt.src != '') {
|
||||
cardArt.src = cardArt.src
|
||||
cardArt.onload()
|
||||
} else if (skipResizeCardArt > 0) {
|
||||
skipResizeCardArt -= 1
|
||||
}
|
||||
if (skipLoadTextList > 0) {
|
||||
skipLoadTextList -= 1
|
||||
}
|
||||
manaCostUpdated()
|
||||
bottomInfoUpdated()
|
||||
@@ -517,7 +533,7 @@ function writeText(textObjectList, targetContext) {
|
||||
if (possibleCodeLower == 'line' && !oneLine) {
|
||||
finishLine = true
|
||||
paragraphSpace += textSize * 0.35
|
||||
} else if (possibleCodeLower == 'linenospace' && !oneLine) {
|
||||
} else if ((possibleCodeLower == 'linenospace' || possibleCodeLower == 'lns') && !oneLine) {
|
||||
finishLine = true
|
||||
} else if ((possibleCodeLower == 'bar' || possibleCodeLower == 'flavor') && !oneLine) {
|
||||
finishLine = true
|
||||
@@ -748,6 +764,7 @@ function addUploadedFrameImage(imageSource) {
|
||||
}
|
||||
|
||||
function manaCostUpdated() {
|
||||
usedManaSymbols = []
|
||||
manaCostContext.clearRect(0, 0, cardWidth, cardHeight)
|
||||
var manaCostList = document.getElementById('inputManaCost').value.toLowerCase().replace(/{/g, ' ').replace(/}/g, ' ').split('/').join('').split(' ')
|
||||
var manaSymbolIndex = -1
|
||||
@@ -757,6 +774,7 @@ function manaCostUpdated() {
|
||||
}
|
||||
for (var i = 0; i < manaCostList.length; i++) {
|
||||
if (manaSymbolCodeList.includes(manaCostList[i])) {
|
||||
usedManaSymbols.push(manaCostList[i])
|
||||
manaSymbolIndex += 1
|
||||
var x = eval(manaCostXPath)
|
||||
var y = eval(manaCostYPath)
|
||||
@@ -963,7 +981,7 @@ var textCodeReferenceArray = [
|
||||
['{flavor}', 'Moves to the next line, draws the flavor text bar, and italicizes the text'],
|
||||
['{i}', 'Italicizes the text'],
|
||||
['{/i}', 'Removes italicization'],
|
||||
['{fontsize#}', 'Changes the font size by # pixels'],
|
||||
['{fontsize#}', 'Changes the font size by # pixels (relative - use negative numbers to shrink text)'],
|
||||
['{fontcolor#}', 'Changes the font color to #'],
|
||||
['{left}', 'Aligns the text to the left'],
|
||||
['{center}', 'Aligns the text to the center'],
|
||||
@@ -972,8 +990,9 @@ var textCodeReferenceArray = [
|
||||
['{right#}', 'Shifts the following text # pixels to the right'],
|
||||
['{up#}', 'Shifts the following text # pixels up'],
|
||||
['{down#}', 'Shifts the following text # pixels down'],
|
||||
['{outline*,#}', 'Outlines the following text by # pixels in * color'],
|
||||
['{shadow#}', 'Adds a shadow # pixels away from the following text']
|
||||
['{outline:*,#}', 'Outlines the following text by # pixels in * color'],
|
||||
['{shadow#}', 'Adds a shadow # pixels away from the following text'],
|
||||
['Notes:', 'For colors, you may use HTML color codes (ie \'green\'), hex color codes (ie \'#00ff00\'), or rgb (ie \'rgb(0,255,0)\')']
|
||||
]
|
||||
function textCodeReference() {
|
||||
textCodeReferenceArray.forEach(item => document.getElementById('textCodeReference').innerHTML += '<div>' + item[0] + '</div><div>' + item[1] + '</div>')
|
||||
|
@@ -20,6 +20,13 @@ if (currentVersion != 'm15/devoid') {
|
||||
artY = scaleY(218 / 2100)
|
||||
artWidth = scaleX(1380 / 1500)
|
||||
artHeight = scaleY(1720 / 2100)
|
||||
|
||||
if (skipResizeCardArt > 0) {
|
||||
skipResizeCardArt -= 1
|
||||
}
|
||||
if (skipLoadTextList > 0) {
|
||||
skipLoadTextList -= 1
|
||||
}
|
||||
}
|
||||
|
||||
hideFrameImages('frameClassM15Devoid')
|
@@ -6,4 +6,20 @@ if (!loadedVersions.includes('m15/invention')) {
|
||||
], 'frameClassM15Invention')
|
||||
}
|
||||
|
||||
if (currentVersion != 'm15/invention') {
|
||||
currentVersion = 'm15/invention'
|
||||
|
||||
artX = scaleX(60 / 1500)
|
||||
artY = scaleY(60 / 2100)
|
||||
artWidth = scaleX(1380 / 1500)
|
||||
artHeight = scaleY(1878 / 2100)
|
||||
|
||||
if (skipResizeCardArt > 0) {
|
||||
skipResizeCardArt -= 1
|
||||
}
|
||||
if (skipLoadTextList > 0) {
|
||||
skipLoadTextList -= 1
|
||||
}
|
||||
}
|
||||
|
||||
hideFrameImages('frameClassM15Invention')
|
@@ -16,7 +16,8 @@ if (!loadedVersions.includes('m15/m21')) {
|
||||
['Black Power/Toughness', '/data/images/cardImages/m15/m21/m15M21PTB.png', 1136/1500, 1858/2100, 282/1500, 154/2100, ['Full']],
|
||||
['Red Power/Toughness', '/data/images/cardImages/m15/m21/m15M21PTR.png', 1136/1500, 1858/2100, 282/1500, 154/2100, ['Full']],
|
||||
['Green Power/Toughness', '/data/images/cardImages/m15/m21/m15M21PTG.png', 1136/1500, 1858/2100, 282/1500, 154/2100, ['Full']],
|
||||
['Holo Stamp', '/data/images/cardImages/m15/m21/m15M21Stamp.png', 709/1500, 1873/2100, 82/1500, 82/2100, ['Full']]
|
||||
['Holo Stamp', '/data/images/cardImages/m15/m21/m15M21Stamp.png', 709/1500, 1873/2100, 82/1500, 82/2100, ['Full']],
|
||||
['Chandra\'s Fire', '/data/images/cardImages/m15/m21/m15M21Fire.png', 11/1500, 1725/2100, 1480/1500, 320/2100, ['Full']]
|
||||
], 'frameClassM15M21Showcase')
|
||||
addToManaSymbolList('/data/images/cardImages/manaSymbols/m21/', ["m210", "m211", "m212", "m213", "m214", "m215", "m216", "m217", "m218", "m219", "m21w", "m21u", "m21b", "m21r", "m21g", "m21x",])
|
||||
addToManaSymbolList('/data/images/cardImages/manaSymbols/m21/dark/', ["dm210", "dm211", "dm212", "dm213", "dm214", "dm215", "dm216", "dm217", "dm218", "dm219", "dm21w", "dm21u", "dm21b", "dm21r", "dm21g", "dm21x",])
|
||||
|