Remove rotation on market and discard cards

Closes #16
This commit is contained in:
2024-05-13 17:12:01 +02:00
parent 2c4f9abc8d
commit bf036da9a0
4 changed files with 11 additions and 7 deletions
+4 -2
View File
@@ -5,10 +5,12 @@ export interface Props {
card_id: number | undefined card_id: number | undefined
locked?: boolean locked?: boolean
wrapped?: boolean wrapped?: boolean
tilted?: boolean
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
wrapped: () => false, wrapped: () => false,
tilted: () => true
}) })
@@ -40,8 +42,8 @@ watch(
<template> <template>
<div :class="`card ${childCount > 0 ? 'active' : ''} ${wrapped ? 'wrapped' : ''} ${props.locked ? 'locked' : ''}`" <div :class="`card ${childCount > 0 ? 'active' : ''} ${wrapped ? 'wrapped' : ''} ${props.locked ? 'locked' : ''}`"
@contextmenu.prevent="false" @click.left="cardClick" :style="`rotate:${rotation}deg;`" @mouseenter="mouseenter" @contextmenu.prevent="false" @click.left="cardClick" :style="tilted ? `rotate:${rotation}deg;` : ''"
@mouseleave="mouseleave"> @mouseenter="mouseenter" @mouseleave="mouseleave">
<div id="contextMenuButtons" :ref="(el) => { childCount = ((el as Element)?.childElementCount ?? 0) }"> <div id="contextMenuButtons" :ref="(el) => { childCount = ((el as Element)?.childElementCount ?? 0) }">
<slot></slot> <slot></slot>
</div> </div>
+4 -3
View File
@@ -9,9 +9,10 @@ const isTurn = computed(() => goStore.self && goStore.current_game?.started && (
<template> <template>
<div id="market"> <div id="market">
<CardPreview :card_id="undefined"></CardPreview> <CardPreview :tilted="false" :card_id="undefined"></CardPreview>
<div class="separator"></div> <div class="separator"></div>
<CardPreview :card_id="c?.card_id" v-for="c in goStore.current_game?.market" @click="c && buy(c)"> <CardPreview :tilted="false" :card_id="c?.card_id" v-for="c in goStore.current_game?.market"
@click="c && buy(c)">
<template <template
v-if="isTurn && goStore.self?.turn && c && c.cost && (goStore.self?.turn.gold_reserve ?? 0) >= c.cost"> v-if="isTurn && goStore.self?.turn && c && c.cost && (goStore.self?.turn.gold_reserve ?? 0) >= c.cost">
<button @click.stop="buy(c)">BUY</button> <button @click.stop="buy(c)">BUY</button>
@@ -29,7 +30,7 @@ const isTurn = computed(() => goStore.self && goStore.current_game?.started && (
</template> </template>
</CardPreview> </CardPreview>
<div class="separator"></div> <div class="separator"></div>
<CardPreview :card_id="goStore.current_game?.gem_stack.at(-1)?.card_id" <CardPreview :tilted="false" :card_id="goStore.current_game?.gem_stack.at(-1)?.card_id"
@click="buy(goStore.current_game?.gem_stack.at(-1)!)"> @click="buy(goStore.current_game?.gem_stack.at(-1)!)">
<template <template
v-if="isTurn && goStore.self?.turn && goStore.current_game?.gem_stack.length && goStore.current_game?.gem_stack.length > 0 && (goStore.self?.turn.gold_reserve ?? 0) >= (goStore.current_game?.gem_stack.at(-1)?.cost ?? Infinity)"> v-if="isTurn && goStore.self?.turn && goStore.current_game?.gem_stack.length && goStore.current_game?.gem_stack.length > 0 && (goStore.self?.turn.gold_reserve ?? 0) >= (goStore.current_game?.gem_stack.at(-1)?.cost ?? Infinity)">
+1 -1
View File
@@ -44,7 +44,7 @@ const props = defineProps<Props>()
<div class="view"> <div class="view">
<PlayerSlot :player="player" :hide_stack_and_discard="true" v-if="view == 'main'" /> <PlayerSlot :player="player" :hide_stack_and_discard="true" v-if="view == 'main'" />
<template v-if="view == 'discard'"> <template v-if="view == 'discard'">
<CardPreview v-for=" card in player.discard_pile " :card_id="card.card_id"> <CardPreview :tilted="false" v-for=" card in player.discard_pile " :card_id="card.card_id">
</CardPreview> </CardPreview>
</template> </template>
+2 -1
View File
@@ -66,7 +66,8 @@ const prepare_champion = (target: Card) => run_effect(CardEffects.PREPARE, targe
</div> </div>
<div :class="`discard ${discard_unwrapped ? 'unwrapped' : ''}`"> <div :class="`discard ${discard_unwrapped ? 'unwrapped' : ''}`">
<CardsGrouped :stack="props.player.discard_pile" v-if="!props.discard_unwrapped"> </CardsGrouped> <CardsGrouped :stack="props.player.discard_pile" v-if="!props.discard_unwrapped"> </CardsGrouped>
<CardPreview v-if="props.discard_unwrapped" :card_id="c.card_id" v-for="c in props.player.discard_pile"> <CardPreview :tilted="false" v-if="props.discard_unwrapped" :card_id="c.card_id"
v-for="c in props.player.discard_pile">
<template v-if="goStore.self?.turn && c && isSelf && isPlayerTurn"> <template v-if="goStore.self?.turn && c && isSelf && isPlayerTurn">
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click.stop="sacrifice(c)"> <button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click.stop="sacrifice(c)">