From 761baaf461b01851582d4dc6f1d1ca0d440c7863 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 10 Sep 2019 09:55:34 +0200 Subject: [PATCH] Add exporting deck to ponyhead --- src/views/DeckBuilder.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/DeckBuilder.vue b/src/views/DeckBuilder.vue index 671adc4..b778549 100644 --- a/src/views/DeckBuilder.vue +++ b/src/views/DeckBuilder.vue @@ -138,7 +138,8 @@ import { CardSlot, getCards, allSets, - cardFullName + cardFullName, + createPonyheadURL } from "@/mlpccg"; const colorNames = [ @@ -410,7 +411,9 @@ export default class DeckBuilder extends Vue { // Check if card is already in const idx = this.decklist.findIndex(c => c.data.ID == card.ID); if (idx >= 0) { - this.decklist[idx].howmany += 1; + const deckitem = this.decklist[idx]; + deckitem.howmany += 1; + Vue.set(this.decklist, idx, deckitem); } else { this.decklist.push({ 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"); + } }