hide controls when the game ends
This commit is contained in:
parent
b5ba169ce4
commit
2cb683eafb
@ -18,7 +18,7 @@
|
|||||||
<Player :stats="props.game.players[1]" :dealer="false" :disabled="props.dealer || !myTurn" @item="(evt: number) => useItem(evt)" />
|
<Player :stats="props.game.players[1]" :dealer="false" :disabled="props.dealer || !myTurn" @item="(evt: number) => useItem(evt)" />
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-if="myTurn" class="py-4">
|
<v-row v-if="myTurn && !gameOver" class="py-4">
|
||||||
<v-col cols="1"></v-col>
|
<v-col cols="1"></v-col>
|
||||||
<v-col cols="5">
|
<v-col cols="5">
|
||||||
<v-btn block @click="attack(true)">SHOOT {{ dealerTarget }}</v-btn>
|
<v-btn block @click="attack(true)">SHOOT {{ dealerTarget }}</v-btn>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<v-btn block @click="attack(false)">SHOOT {{ challTarget }}</v-btn>
|
<v-btn block @click="attack(false)">SHOOT {{ challTarget }}</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-else class="py-4">
|
<v-row v-else-if="!gameOver" class="py-4">
|
||||||
<v-col cols="3"></v-col>
|
<v-col cols="3"></v-col>
|
||||||
<v-col cols="6">
|
<v-col cols="6">
|
||||||
<v-btn block disabled>THE {{ currentTurn }} IS CONSIDERING</v-btn>
|
<v-btn block disabled>THE {{ currentTurn }} IS CONSIDERING</v-btn>
|
||||||
@ -63,7 +63,8 @@ export interface Emits {
|
|||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
const myTurn = computed(() => props.dealer === props.game.dealer);
|
const gameOver = computed(() => props.game.winner == null);
|
||||||
|
const myTurn = computed(() => gameOver.value && props.dealer === props.game.dealer);
|
||||||
const currentTurn = computed(() => props.game.dealer ? 'DEALER' : 'CHALLENGER');
|
const currentTurn = computed(() => props.game.dealer ? 'DEALER' : 'CHALLENGER');
|
||||||
|
|
||||||
const dealerTarget = computed(() => props.dealer ? 'YOURSELF' : 'THE DEALER');
|
const dealerTarget = computed(() => props.dealer ? 'YOURSELF' : 'THE DEALER');
|
||||||
|
Loading…
Reference in New Issue
Block a user