Merge branch 'main' of git.legonzaur.fr:legonzaur/heron-realms-front
release-tag / release-image (push) Successful in 29s

This commit is contained in:
2024-05-16 11:27:28 +02:00
+34 -1
View File
@@ -4,6 +4,29 @@ 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>
@@ -13,7 +36,8 @@ const isTurn = computed(() => goStore.self?.team == goStore.current_game?.curren
:disabled="!goStore.self.turn.find_effect(CardEffects.MAKE_DISCARD)">
make Discard</button>
<div id="turn_data">
<button id="end_turn" v-if="isTurn" @click="endTurn">END TURN</button>
<div class="warning" v-if="warning">/!\<br> Effets restants!<br> /!\</div>
<button id="end_turn" v-if="isTurn" @click="checkEndTurn">END TURN</button>
<PlayerStats v-if="goStore.self" :player='goStore.self'></PlayerStats>
</div>
@@ -61,6 +85,15 @@ const isTurn = computed(() => goStore.self?.team == goStore.current_game?.curren
z-index: 9;
}
.warning {
background-color: rgba(255, 0, 0, 0.7);
color: white;
padding: 5px;
border-radius: 5px;
width: 60px;
font-size: 0.9em;
}
#end_turn {
z-index: 10;
}