58 lines
1.9 KiB
Vue
58 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import goStore, { buy, endTurn } from '@/netcode';
|
|
|
|
const isTurn = computed(() => goStore.self && goStore.game?.started && (goStore.self.team == goStore.game.current_turn))
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div @contextmenu.prevent="false">
|
|
<button v-if="isTurn" @click="endTurn">END TURN</button>
|
|
<div v-if="!goStore.self"><b>SPECTATOR MODE</b></div>
|
|
<div>
|
|
market_amount = {{ goStore.game?.market_stack?.length }}
|
|
<br>
|
|
market =
|
|
<div class="cards_container">
|
|
<CardPreview :data="c" v-for="c in goStore.game?.market">
|
|
<template v-if="isTurn && c">
|
|
<button @click="buy(c)">BUY</button>
|
|
<!-- <button @click="buy_in_hand(c)">
|
|
BUY IN HAND
|
|
</button>
|
|
<button @click="buy_on_stack(c)">
|
|
BUY ON STACK
|
|
</button> -->
|
|
</template>
|
|
</CardPreview>
|
|
</div>
|
|
|
|
<br>
|
|
gems =
|
|
<CardSlot :stack="goStore.game?.gem_stack">
|
|
<template v-if="isTurn && goStore.game?.gem_stack.length && goStore.game?.gem_stack.length > 0">
|
|
<button @click="buy(goStore.game.gem_stack.at(-1)!)">
|
|
BUY
|
|
</button>
|
|
<!-- <button @click="buy_in_hand(props.game.gem_stack.at(-1))">
|
|
BUY IN HAND
|
|
</button>
|
|
<button @click="buy_on_stack(props.game.gem_stack.at(-1))">
|
|
BUY ON STACK
|
|
</button> -->
|
|
</template>
|
|
</CardSlot>
|
|
</div>
|
|
<div>
|
|
<PlayerList>
|
|
</PlayerList>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style>
|
|
.cards_container {
|
|
display: flex;
|
|
flex-direction: row;
|
|
}
|
|
</style> |