Add exporting deck to ponyhead
This commit is contained in:
parent
8188582183
commit
761baaf461
1 changed files with 10 additions and 2 deletions
|
@ -138,7 +138,8 @@ import {
|
||||||
CardSlot,
|
CardSlot,
|
||||||
getCards,
|
getCards,
|
||||||
allSets,
|
allSets,
|
||||||
cardFullName
|
cardFullName,
|
||||||
|
createPonyheadURL
|
||||||
} from "@/mlpccg";
|
} from "@/mlpccg";
|
||||||
|
|
||||||
const colorNames = [
|
const colorNames = [
|
||||||
|
@ -410,7 +411,9 @@ export default class DeckBuilder extends Vue {
|
||||||
// Check if card is already in
|
// Check if card is already in
|
||||||
const idx = this.decklist.findIndex(c => c.data.ID == card.ID);
|
const idx = this.decklist.findIndex(c => c.data.ID == card.ID);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
this.decklist[idx].howmany += 1;
|
const deckitem = this.decklist[idx];
|
||||||
|
deckitem.howmany += 1;
|
||||||
|
Vue.set(this.decklist, idx, deckitem);
|
||||||
} else {
|
} else {
|
||||||
this.decklist.push({
|
this.decklist.push({
|
||||||
data: card,
|
data: card,
|
||||||
|
@ -419,5 +422,10 @@ export default class DeckBuilder extends Vue {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private exportToPonyhead() {
|
||||||
|
const url = createPonyheadURL(this.decklist.map(c => c.data));
|
||||||
|
window.open(url, "_blank");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue