yes
All checks were successful
Build / build (push) Successful in 18s
Linter / Linter (push) Successful in 17s

This commit is contained in:
Maieul BOYER 2026-01-17 10:42:51 +01:00
parent 48c33b3568
commit 4cb0104124
No known key found for this signature in database
2 changed files with 34 additions and 8 deletions

View file

@ -107,7 +107,9 @@ function tourinfoButtons(tourInfo : HTMLButtonElement, tourScoreScreen : HTMLDiv
});
}
function gameJoinButtons(socket : CSocket, inTournament : boolean, currentGame : currentGameInfo | null,
let inTournament: boolean = false;
function gameJoinButtons(socket : CSocket, currentGame : currentGameInfo | null,
tournament : HTMLButtonElement, queue : HTMLButtonElement, localGame : HTMLButtonElement, ready : HTMLButtonElement)
{
tournament.addEventListener("click", () => {
@ -150,6 +152,10 @@ function gameJoinButtons(socket : CSocket, inTournament : boolean, currentGame :
}
});
localGame.addEventListener("click", () => {
if (inTournament) {
showError("You can't queue up currently !");
return;
}
if (
queue.innerText !== QueueState.Iddle ||
currentGame !== null ||
@ -274,7 +280,7 @@ function pongClient(
setTitle("Pong Game");
const urlParams = new URLSearchParams(window.location.search);
let game_req_join = urlParams.get("game");
let inTournament = false;
inTournament = false;
return {
html: authHtml,
@ -548,7 +554,7 @@ function pongClient(
setInterval(() => {keys_listen_setup(currentGame, socket, keys, playHow, playHow_b, tourScoreScreen, queue)}, 1000 / 60);
gameJoinButtons(socket, inTournament, currentGame, tournament, queue, localGame, ready);
gameJoinButtons(socket, currentGame, tournament, queue, localGame, ready);
playhowButtons(playHow_b, playHow);
tourinfoButtons(tourInfo, tourScoreScreen);