mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
Support importing art for Adventure cards
This commit is contained in:
@@ -3874,14 +3874,7 @@ function stretchSVGReal(data, frameObject) {
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
//SCRYFALL STUFF MAY BE CHANGED IN THE FUTURE
|
||||
function fetchScryfallData(cardName, callback = console.log, searchUniqueArt = '') {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
responseCards = [];
|
||||
importedCards = JSON.parse(this.responseText).data;
|
||||
importedCards.forEach(card => {
|
||||
function processScryfallCard(card, responseCards) {
|
||||
if ('card_faces' in card) {
|
||||
card.card_faces.forEach(face => {
|
||||
face.set = card.set;
|
||||
@@ -3892,6 +3885,9 @@ function fetchScryfallData(cardName, callback = console.log, searchUniqueArt = '
|
||||
face.type_line = face.printed_type_line;
|
||||
}
|
||||
responseCards.push(face);
|
||||
if (!face.image_uris) {
|
||||
face.image_uris = card.image_uris;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (card.lang != 'en') {
|
||||
@@ -3901,6 +3897,17 @@ function fetchScryfallData(cardName, callback = console.log, searchUniqueArt = '
|
||||
}
|
||||
responseCards.push(card);
|
||||
}
|
||||
}
|
||||
|
||||
//SCRYFALL STUFF MAY BE CHANGED IN THE FUTURE
|
||||
function fetchScryfallData(cardName, callback = console.log, searchUniqueArt = '') {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
responseCards = [];
|
||||
importedCards = JSON.parse(this.responseText).data;
|
||||
importedCards.forEach(card => {
|
||||
processScryfallCard(card, responseCards);
|
||||
});
|
||||
callback(responseCards);
|
||||
} else if (this.readyState == 4 && this.status == 404 && !searchUniqueArt && cardName != '') {
|
||||
|
Reference in New Issue
Block a user