mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
notifications, mana symbols
This commit is contained in:
@@ -13,14 +13,23 @@ var selectedMaskImage = 0
|
||||
var selectedCardMasterElement = -1
|
||||
var selectedTextObject
|
||||
var cardTextList = new Array()
|
||||
var manaSymbolCodeList = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "w", "u", "b", "r", "g", "2w", "2u", "2b", "2r", "2g", "pw", "pu", "pb", "pr", "pg", "wu", "wb", "ub", "ur", "br", "bg", "rg", "rw", "gw", "gu", "x", "s", "c", "t","untap", "e", "y", "z", "half", "inf", "chaos", "plane", "l+", "l-", "l0", "oldtap", "artistbrush", "bar", "whiteBrush", "blackBrush"]
|
||||
var manaSymbolCodeList = []
|
||||
var manaSymbolImageList = []
|
||||
var deletingCardObject = false
|
||||
manaSymbolCodeList.forEach((item, index) => {manaSymbolImageList[index] = new Image(); manaSymbolImageList[index].src = 'data/images/manaSymbols/' + index + '.png'})
|
||||
date = new Date()
|
||||
var cornerCutout = new Image()
|
||||
cornerCutout.src = 'data/images/cornerCutout.png'
|
||||
|
||||
function addToManaSymbolList(folderPath, newManaSymbolList) {
|
||||
for (var i = 0; i < newManaSymbolList.length; i ++) {
|
||||
manaSymbolCodeList.push(newManaSymbolList[i])
|
||||
manaSymbolImageList.push(new Image())
|
||||
manaSymbolImageList[manaSymbolImageList.length - 1].src = folderPath + newManaSymbolList[i] + '.png'
|
||||
}
|
||||
}
|
||||
|
||||
addToManaSymbolList('data/images/manaSymbols/', ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "w", "u", "b", "r", "g", "2w", "2u", "2b", "2r", "2g", "pw", "pu", "pb", "pr", "pg", "wu", "wb", "ub", "ur", "br", "bg", "rg", "rw", "gw", "gu", "x", "s", "c", "t","untap", "e", "y", "z", "half", "inf", "chaos", "plane", "l+", "l-", "l0", "oldtap", "artistbrush", "bar", "whiteBrush", "blackBrush"])
|
||||
|
||||
function newCanvas(name) {
|
||||
window[name + 'Canvas'] = document.createElement('canvas')
|
||||
window[name + 'Canvas'].width = cardWidth
|
||||
@@ -626,7 +635,7 @@ function inputCardArtName(cardArtNameInput) {
|
||||
}
|
||||
inputCardArtNameNumber(1)
|
||||
} else if (this.readyState == 4 && this.status == 404) {
|
||||
alert("Sorry, but we can't seem to find any art for " + cardArtNameInput)
|
||||
notify("Sorry, but we can't seem to find any art for '" + cardArtNameInput + "'", '#ffffaae0')
|
||||
}
|
||||
}
|
||||
xhttp.open('GET', 'https://api.scryfall.com/cards/search?order=released&unique=art&q=name%3D' + cardArtNameInput.replace(/ /g, '_'), true)
|
||||
@@ -743,7 +752,7 @@ function inputCardNameTextImport(cardName) {
|
||||
document.getElementById('inputCardNameNumberTextImport').value = 1
|
||||
} else if (this.readyState == 4 && this.status == 404) {
|
||||
savedImportResponse = ''
|
||||
alert("Sorry, but we can't seem to find any card named '" + cardName + "'")
|
||||
notify("Sorry, but we can't seem to find any card named '" + cardName + "'", '#ffffaae0')
|
||||
}
|
||||
}
|
||||
xhttp.open('GET', 'https://api.scryfall.com/cards/search?order=released&q=name%3D' + cardName.replace(/ /g, '+'), true)
|
||||
@@ -818,11 +827,11 @@ function downloadCardImage(linkElement) {
|
||||
}
|
||||
} else {
|
||||
event.preventDefault()
|
||||
alert("You must properly credit an artist before downloading!")
|
||||
notify("You must properly credit an artist before downloading!", '#ffaaaae0')
|
||||
}
|
||||
var cardImageData = mainCanvas.toDataURL()
|
||||
if (cardImageData == undefined) {
|
||||
alert("Sorry, but it seems that you cannot download your card. Please try using a different browser/device.")
|
||||
notify("Sorry, but it seems that you cannot download your card. Please try using a different browser/device.", '#ffffaae0')
|
||||
}
|
||||
linkElement.href = cardImageData
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
if (!loadedVersions.includes('future')) {
|
||||
loadedVersions.push('future')
|
||||
loadMaskImages([['Border (future)', 'data/images/future/futureMaskBorder.png'], ['Artifact Icon (future)', 'data/images/future/futureMaskArtifact.png'], ['Creature Icon (future)', 'data/images/future/futureMaskCreature.png'], ['Enchantment Icon (future)', 'data/images/future/futureMaskEnchantment.png'], ['Instant Icon (future)', 'data/images/future/futureMaskInstant.png'], ['Land Icon (future)', 'data/images/future/futureMaskLand.png'], ['Multitype Icon (future)', 'data/images/future/futureMaskMulti.png'], ['Sorcery Icon (future)', 'data/images/future/futureMaskSorcery.png']])
|
||||
addToManaSymbolList('data/images/manaSymbols/future/', ["f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "fw", "fu", "fb", "fr", "fg", "fwu", "fwb", "fub", "fur", "fbr", "fbg", "frg", "frw", "fgw", "fgu", "fx"])
|
||||
notify('The Future Shifted frame uses special mana symbols for 1-20, WUBRG, all hybrid mana symbols, and X. If you would like to use these, just add an "f" at the beginning of each symbol. For example, "2 g g" would become "f2 fg fg".', '#aaffaae0')
|
||||
}
|
||||
|
||||
if (currentVersion != 'future') {
|
||||
|
@@ -18,6 +18,8 @@ if (!loadedVersions.includes('m15M21Showcase')) {
|
||||
['Green Power/Toughness', 'data/images/m15/m21/m15M21PTG.png', 1136/1500, 1858/2100, 282/1500, 154/2100, ['Full']],
|
||||
['Holo Stamp', 'data/images/m15/m21/m15M21Stamp.png', 709/1500, 1873/2100, 82/1500, 82/2100, ['Full']]
|
||||
], 'frameClassM15M21Showcase')
|
||||
// addToManaSymbolList('data/images/manaSymbols/future/', ["f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "fw", "fu", "fb", "fr", "fg", "fwu", "fwb", "fub", "fur", "fbr", "fbg", "frg", "frw", "fgw", "fgu", "fx"])
|
||||
// notify('The Future Shifted frame uses special mana symbols for 1-20, WUBRG, all hybrid mana symbols, and X. If you would like to use these, just add an "f" at the beginning of each symbol. For example, "2 g g" would become "f2 fg fg".', '#aaffaae0')
|
||||
}
|
||||
|
||||
if (currentVersion != 'm15M21Showcase') {
|
||||
|
Reference in New Issue
Block a user