Closes #48
This commit is contained in:
+11
-29
@@ -4,40 +4,13 @@ import { CardEffects } from '@/netcode/Effect'
|
||||
|
||||
const isTurn = computed(() => goStore.self?.team == goStore.current_game?.current_turn)
|
||||
|
||||
let warning = ref(false)
|
||||
|
||||
function checkEndTurn() {
|
||||
// TODO: Add a confirmation dialog if resources are left
|
||||
console.log("Checking end turn")
|
||||
if (
|
||||
(!warning.value)
|
||||
&& (
|
||||
(goStore.self?.turn?.damage_reserve ? goStore.self?.turn?.damage_reserve > 0 : false)
|
||||
|| (goStore.self?.turn?.gold_reserve ? goStore.self?.turn?.gold_reserve > 0 : false)
|
||||
|| (goStore.self?.turn?.fuck_u_markers ? goStore.self?.turn?.fuck_u_markers > 0 : false)
|
||||
)) {
|
||||
// Set a warning flag to true
|
||||
// Display an alert somehow using this warning flag
|
||||
warning.value = true
|
||||
}
|
||||
else {
|
||||
warning.value = false
|
||||
endTurn()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<PlayerStats v-if="goStore.self" :player='goStore.self'></PlayerStats>
|
||||
<button id="end_turn" v-if="isTurn" @click="checkEndTurn">END TURN</button>
|
||||
<div class="warning" v-if="warning">/!\<br> Effets restants!<br> /!\</div>
|
||||
<div class="cards_container" id="self_hand">
|
||||
<CardPreview :card_id="c?.card_id" v-for=" c in goStore.self?.hand " @click="c && playCard(c)">
|
||||
<button v-if="c && isTurn && goStore.self?.turn && (goStore.self.turn.discard_markers ?? 0) > 0"
|
||||
@click="discard(c!)">DISCARD</button>
|
||||
<button v-if="c && goStore.self?.turn && (goStore.self.turn.fuck_u_markers ?? 0) > 0"
|
||||
@click="discard(c)">DISCARD</button>
|
||||
</CardPreview>
|
||||
</div>
|
||||
|
||||
@@ -118,6 +91,15 @@ function checkEndTurn() {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#self_hand .card #contextMenuButtons {
|
||||
top: 0;
|
||||
bottom: unset;
|
||||
}
|
||||
|
||||
#self_hand .card.active:hover #contextMenuButtons {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
|
||||
#self_hand .card:hover {
|
||||
transform: translateY(-40px);
|
||||
|
||||
Reference in New Issue
Block a user