From 8dc263ab5003414078386f0163c96b24b5c407f3 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 14 Jul 2024 14:49:05 +0200 Subject: [PATCH] Chore : various fixes --- components/CardPreview.vue | 85 +++++++++++++++++++++---------------- components/CardsGrouped.vue | 44 ++++++++++++------- components/PlayerSlot.vue | 8 ++++ netcode/index.ts | 14 +++++- pages/game/[id].vue | 54 +++++++++++++++++++++-- 5 files changed, 147 insertions(+), 58 deletions(-) diff --git a/components/CardPreview.vue b/components/CardPreview.vue index 35145c5..539fe10 100644 --- a/components/CardPreview.vue +++ b/components/CardPreview.vue @@ -10,6 +10,7 @@ export interface Props { interactible?: boolean; noEffects?: boolean; used_effects_indexes?: number[]; + discardable?: boolean; } const props = withDefaults(defineProps(), { @@ -18,6 +19,7 @@ const props = withDefaults(defineProps(), { locked: () => true, interactible: () => true, noEffects: () => false, + discardable: () => false, }); const emit = defineEmits([ @@ -225,6 +227,7 @@ onUnmounted(() => { unlocked: !props.locked, zoom: isZooming, no_effects: noEffects || !props.locked, + discardable, }" @contextmenu.prevent="false" @mousedown.right="rightClickDown" @@ -281,43 +284,6 @@ onUnmounted(() => { diff --git a/components/CardsGrouped.vue b/components/CardsGrouped.vue index 84c85f5..436484e 100644 --- a/components/CardsGrouped.vue +++ b/components/CardsGrouped.vue @@ -18,6 +18,7 @@ export interface Props { noEffects?: boolean; tokens?: Effect[]; championsKillable?: boolean; + discardable?: boolean; } const props = withDefaults(defineProps(), { @@ -26,6 +27,7 @@ const props = withDefaults(defineProps(), { noEffects: () => false, tokens: () => [], championsKillable: () => false, + discardable: () => false, }); const emit = defineEmits([ @@ -33,6 +35,7 @@ const emit = defineEmits([ "effectClick", "tokenClick", "damageChampionClick", + "discardCardClick", ]); const settingsStore = useSettingsStore(); @@ -123,6 +126,10 @@ function tokenClick(token: Effect, card: Card) { function damageChampionClick(card: Card) { emit("damageChampionClick", card); } + +function discardCardClick(card: Card) { + emit("discardCardClick", card); +}