This commit is contained in:
+20
-9
@@ -8,6 +8,7 @@ import {
|
||||
joinGame,
|
||||
deleteGame,
|
||||
leaveGame,
|
||||
surrender,
|
||||
} from "~/netcode";
|
||||
import { delay } from "~/netcode/events";
|
||||
import {
|
||||
@@ -262,7 +263,14 @@ onUnmounted(() => {
|
||||
|
||||
<!-- <LoadingScreen v-if="!loaded"></LoadingScreen> -->
|
||||
<footer>
|
||||
<GameModalOptionsDialog></GameModalOptionsDialog>
|
||||
<div>
|
||||
<GameModalOptionsDialog></GameModalOptionsDialog>
|
||||
<GameModalConfigureDialog
|
||||
v-if="game && game.owner.userId == authStore.selfUser.userId"
|
||||
:game="game"
|
||||
></GameModalConfigureDialog>
|
||||
</div>
|
||||
|
||||
<ClientOnly>
|
||||
<div id="turn_buttons" v-if="game">
|
||||
<template v-if="game.started">
|
||||
@@ -284,26 +292,29 @@ onUnmounted(() => {
|
||||
>
|
||||
Start game
|
||||
</button>
|
||||
<GameModalConfigureDialog :game="game"></GameModalConfigureDialog>
|
||||
</template>
|
||||
|
||||
<button
|
||||
class="end_turn_button turn_icon"
|
||||
@click="joinGame(game._id)"
|
||||
v-else-if="
|
||||
playerList?.every(
|
||||
(p) => p.user.userId != authStore.selfUser.userId
|
||||
)
|
||||
"
|
||||
v-else-if="!selfPlayer"
|
||||
>
|
||||
Join game
|
||||
</button>
|
||||
<button v-else @click="leaveGame(game._id)">Leave game</button>
|
||||
</template>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
v-if="game && game.started && selfPlayer"
|
||||
class="red"
|
||||
@click="surrender(game._id)"
|
||||
>
|
||||
Surrender
|
||||
</button>
|
||||
<button @click="navigateTo('/lobby')">Return to lobby</button>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
|
||||
<button @click="navigateTo('/lobby')">Return to lobby</button>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user