From 6c5df51ed4d6cd0adbab53df277102738fccc70d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 5 Oct 2023 15:05:30 +0200 Subject: Add game "setups" for automated match making and tournaments. --- public/join.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'public') diff --git a/public/join.js b/public/join.js index a22e0fa..2774241 100644 --- a/public/join.js +++ b/public/join.js @@ -156,6 +156,21 @@ function update() { document.getElementById(role_id + "_name").textContent = role let player = players.find(p => p.role === role) let element = document.getElementById(role_id) + + if (game.is_match) { + if (player) { + if (game.status === 1) + element.classList.toggle("is_active", is_active(player, role)) + if (player.user_id === user_id && (game.status === 1 || game.status === 2)) + element.innerHTML = play_link(player) + else + element.innerHTML = user_link(player) + } else { + element.innerHTML = `Empty` + } + continue + } + if (player) { element.classList.remove("is_invite") switch (game.status) { -- cgit v1.2.3