From 821d4b91540c3d214480dbead72004849e9c0c6b Mon Sep 17 00:00:00 2001 From: Namonay Date: Tue, 7 May 2024 14:43:04 +0200 Subject: [PATCH] fix: matchmaking: QOL and typos --- .../static/js/api/game/tictactoe/TicTacToeGame.js | 13 +++++++++++-- frontend/static/js/lang/cr.json | 2 +- frontend/static/js/lang/en.json | 2 +- frontend/static/js/lang/fr.json | 2 +- frontend/static/js/lang/tp.json | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js index b8a1cc0..643321a 100644 --- a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js +++ b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js @@ -90,14 +90,24 @@ class TicTacToe this.context.fillRect(this.width / 2 - 200, this.height - this.gap + 10, 400, 80); this.context.closePath(); this.context.beginPath(); + this.context.font = `20px sans-serif`; this.context.fillStyle = (winning_sign == "o") ? "red" : "green"; - this.context.fillText((winning_sign == "o") ? lang.get("morpionWin") + "O" : lang.get("morpionWin") + "X", this.width / 2 - 30, this.height - this.gap / 2, 140); + this.context.fillText((winning_sign == "o") ? lang.get("morpionWin") + "O" : lang.get("morpionWin") + "X", this.width / 2 - 85, this.height - this.gap / 2 + 10, 180); } printTimer() { let sec = 20; let turn = this.turn + if (this.turn) + { + this.context.beginPath(); + this.context.fillStyle = "white"; + this.context.font = `40px Verdana`; + this.context.fillText(sec, this.width / 2, this.gap / 2); + this.context.closePath(); + sec--; + } let id = setInterval(() => { this.context.beginPath(); @@ -117,7 +127,6 @@ class TicTacToe this.context.fillStyle = "white"; this.context.font = `40px Verdana`; this.context.fillText(sec, this.width / 2, this.gap / 2); - this.context.font = `inherit`; this.context.closePath(); } sec--; diff --git a/frontend/static/js/lang/cr.json b/frontend/static/js/lang/cr.json index 31152ec..7e6c9bd 100644 --- a/frontend/static/js/lang/cr.json +++ b/frontend/static/js/lang/cr.json @@ -46,7 +46,7 @@ "ruleBase" : "cramptun. Vous devez quouicougagner sur une des 9 quoicougrilles pour gagner la croustipartie", "ruleMovement" : "quoicoudeux. Vous quoicommencez sur le morpion quoicoucentral, et jouez sur le quoicoumorpion correspondant a votre croustichoix a votre prochain cramptour", "ruleDraw" : "cramptrois. Si votre quoicouchoix rempli entièrement un quoicoumorpion et provoque une cramptégalité, vous perdez", - "morpionWin" : "Le quoicougagnant est :", + "morpionWin" : "Le quoicougagnant est : ", "matchmakingTitle": "Matchmaking crampté", "matchmakingStartSearch": "Cramptrouver une partie", "matchmakingStopSearch": "Crampter le matchmaking", diff --git a/frontend/static/js/lang/en.json b/frontend/static/js/lang/en.json index fe667e2..da3607a 100644 --- a/frontend/static/js/lang/en.json +++ b/frontend/static/js/lang/en.json @@ -45,7 +45,7 @@ "ruleBase" : "1. Win on one of the 9 tictactoe to win the game", "ruleMovement" : "2. You start on the central tictactoe, and play on the one corresponding to your choice on the next turn", "ruleDraw" : "3. If your play cause a tictactoe to be full and a draw, you lose the game", - "morpionWin" : "The winner is :", + "morpionWin" : "The winner is : ", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "Find a game", "matchmakingStopSearch": "Stop matchmaking", diff --git a/frontend/static/js/lang/fr.json b/frontend/static/js/lang/fr.json index 623bbd2..baa14de 100644 --- a/frontend/static/js/lang/fr.json +++ b/frontend/static/js/lang/fr.json @@ -45,7 +45,7 @@ "ruleBase" : "1. Vous devez gagner sur une des 9 grilles pour gagner la partie", "ruleMovement" : "2. Vous commencez sur le morpion central, et jouez sur le morpion correspondant a votre choix a votre prochain tour", "ruleDraw" : "3. Si votre choix rempli entièrement un morpion et provoque une égalité, vous perdez", - "morpionWin" : "Le gagnant est :", + "morpionWin" : "Le gagnant est : ", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "Trouver une partie", "matchmakingStopSearch": "Arrêter le matchmaking", diff --git a/frontend/static/js/lang/tp.json b/frontend/static/js/lang/tp.json index df0b158..f88eb28 100644 --- a/frontend/static/js/lang/tp.json +++ b/frontend/static/js/lang/tp.json @@ -45,7 +45,7 @@ "ruleBase" : "1. Win on wan pi the 9 tictactoe tawa win the game", "ruleMovement" : "2. Sina open on the central tictactoe, en play on the wan corresponding tawa your choice on the next turn", "ruleDraw" : "3. If your play cause a tictactoe tawa be full en a draw, sina lose the game", - "morpionWin" : "jan li jo e poka sina :", + "morpionWin" : "jan li jo e poka sina : ", "matchmakingTitle": "Matchmaking", "matchmakingStartSearch": "lukin e ilo musi", "matchmakingStopSearch": "o pini e pana sona e jan pi pana sona e jan ante.",