Closes #4
This commit is contained in:
@@ -6,7 +6,7 @@ import { playSound } from '~/helpers/audioHelpers';
|
||||
const current_players = computed<Array<Player>>(() => Array.from(goStore.current_game?.players ?? []).filter(p => p.team === goStore.current_game?.current_turn))
|
||||
|
||||
watch(
|
||||
() => goStore.current_game?.current_turn.uuid,
|
||||
() => goStore.current_game?.current_turn?.uuid,
|
||||
() => {
|
||||
if (goStore.current_game?.current_turn?.uuid == goStore.self?.team?.uuid) {
|
||||
playSound('/sounds/ding.mp3')
|
||||
|
||||
@@ -26,16 +26,27 @@ function killErika() {
|
||||
|
||||
<div class="games-list-zone">
|
||||
<div v-for="g in goStore.lobby?.games">
|
||||
<button v-if="g" @click="join_game(g.uuid)">
|
||||
<template v-if="!g.started">
|
||||
JOIN
|
||||
</template>
|
||||
<template v-if="g.started && !g.ended">
|
||||
SPECTATE
|
||||
</template>
|
||||
<button v-if="g" @click="join_game(g.uuid)" :class="goStore.discordId == g.owner ? 'own_game' : ''">
|
||||
<template v-if="g.started && g.ended">
|
||||
GAME ENDED
|
||||
GAME OVER
|
||||
</template>
|
||||
<template v-if="g.players.every(p => p.discord_id !== goStore.discordId)">
|
||||
<template v-if="!g.started">
|
||||
JOIN
|
||||
</template>
|
||||
<template v-if="g.started && !g.ended">
|
||||
SPECTATE
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="g.players.some(p => p.discord_id == goStore.discordId)">
|
||||
<template v-if="!g.started">
|
||||
JOIN BACK
|
||||
</template>
|
||||
<template v-if="g.started && !g.ended">
|
||||
CONTINUE
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<br>
|
||||
current players:<br><span v-for="p in g.players">{{ p.username }},</span>
|
||||
</button>
|
||||
@@ -146,6 +157,10 @@ function killErika() {
|
||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
|
||||
}
|
||||
|
||||
button.own_game {
|
||||
border: solid yellow 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.overlay {
|
||||
|
||||
Reference in New Issue
Block a user