From df9e7a2e13cd5d4f9b3a7154bad26918b017a847 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 14 Jul 2024 15:54:22 +0200 Subject: [PATCH] Feat : add discard view --- components/CardsGrouped.vue | 7 ++- components/DiscardOverlay.vue | 104 ++++++++++++++++++++++++++++++++++ pages/game/[id].vue | 18 +++++- 3 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 components/DiscardOverlay.vue diff --git a/components/CardsGrouped.vue b/components/CardsGrouped.vue index 436484e..57679d6 100644 --- a/components/CardsGrouped.vue +++ b/components/CardsGrouped.vue @@ -173,7 +173,12 @@ function discardCardClick(card: Card) { (t.effect == CardEffects.STUN && c.cardType == CardType.CHAMPION && championsKillable) || - t.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT + t.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT || + t.effect == CardEffects.RESTACK_DISCARDED_CARD || + (t.effect == CardEffects.RESTACK_DISCARDED_ACTION && + c.cardType == CardType.ACTION) || + (t.effect == CardEffects.RESTACK_DISCARDED_CHAMPION && + c.cardType == CardType.CHAMPION) " > diff --git a/components/DiscardOverlay.vue b/components/DiscardOverlay.vue new file mode 100644 index 0000000..d3a4758 --- /dev/null +++ b/components/DiscardOverlay.vue @@ -0,0 +1,104 @@ + + + + + + + diff --git a/pages/game/[id].vue b/pages/game/[id].vue index 12806b3..a33296f 100644 --- a/pages/game/[id].vue +++ b/pages/game/[id].vue @@ -335,6 +335,10 @@ function useTokenClick(t: Effect) { console.log(t); useToken(game.value!._id, t._id); } + +function showDiscard() { + discard_unwrapped.value = true; +} onUnmounted(() => { eventSource.close(); }); @@ -362,7 +366,12 @@ onUnmounted(() => { :class="{ invisible: discard_unwrapped }" @click="() => (discard_unwrapped = true)" > - + @@ -405,6 +414,13 @@ onUnmounted(() => { > +