mirror of
https://forge.murkfall.net/bluesaxman/deckard.git
synced 2026-03-13 02:34:20 -06:00
Solved the 'joker' problem unique cards and classes of cards implemented
This commit is contained in:
10
index.html
10
index.html
@@ -54,7 +54,15 @@ buttonAdd("#menu","upload","Upload Deck", function () {
|
||||
var myFile = new FileReader();
|
||||
myFile.onload = function (file) {
|
||||
// Probably validate the file somehow befor eating it
|
||||
window.deck = generateDeck(JSON.parse(file.target.result));
|
||||
var ourFile = JSON.parse(file.target.result);
|
||||
if ( Array.isArray(ourFile) ) {
|
||||
window.deck = [];
|
||||
ourFile.forEach(function (deck) {
|
||||
window.deck = window.deck.concat(generateDeck(deck));
|
||||
});
|
||||
} else {
|
||||
window.deck = generateDeck(JSON.parse(file.target.result));
|
||||
}
|
||||
window.hand = [];
|
||||
updateEvent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user