add copy link button

This commit is contained in:
Aleksandr Zaitsev 2024-07-21 20:47:23 +03:00
parent e82accd24b
commit 483dadaa4e

View File

@ -27,8 +27,8 @@ const generate = () => {
//Set ready status for player
const ready = () => {
if (game.mode == 'single') useBotStore().generate()
if (board.isAllItemsReady(game.player.items))
game.ready()
if (game.player.status == 'ready') game.player.status = 'lobby'
if (board.isAllItemsReady(game.player.items)) game.ready()
}
const drawCell = (row, col) => {
let classes = ''
@ -63,7 +63,8 @@ onBeforeUnmount(() => {
<template>
<div class="lobby">
<div class="lobby-buttons">
<button class="button-lobby" @click="generate()">{{ $t("button.generate") }}</button>
<button v-if="game.player.status == 'lobby'" class="button-lobby" @click="generate()">{{ $t("button.generate") }}</button>
<button v-if="game.player.status == 'ready'" class="button-lobby" @click="generate()">{{ $t("button.copy_link") }}</button>
<button class="button-lobby" @click="ready()">{{ game.player.status == 'ready' ? $t("button.cancel") : $t("button.ready") }}</button>
</div>
<div class="lake-border">