added insufficient material condition for draw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chess-client",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
+11
-3
@@ -306,7 +306,7 @@ function renderPlayerBar(barId: string, player: PlayerSnapshot | undefined, isAc
|
||||
const botBadge = player.bot ? `<span class="bot-tag">BOT</span>` : "";
|
||||
const youBadge = isMe ? `<span class="bot-tag you-tag">${L("شما", "YOU")}</span>` : "";
|
||||
const statusLabel = S.phase === "over"
|
||||
? (S.winner === player.seat ? L("برنده 🏆", "Winner 🏆") : "")
|
||||
? (S.winner === player.seat ? L("برنده 🏆", "Winner 🏆") : (S.winner === null ? L("تساوی 🤝", "Draw 🤝") : ""))
|
||||
: (isActive ? (isMe ? L("نوبت شماست", "Your turn") : L("در حال تفکر…", "Thinking…")) : "");
|
||||
|
||||
el.innerHTML = `
|
||||
@@ -428,8 +428,16 @@ function renderModalContainer() {
|
||||
let subtitle = "";
|
||||
|
||||
if (isDraw) {
|
||||
title = S.result_reason === "stalemate" ? L("پات — مساوی!", "Stalemate — Draw!") : L("بازی مساوی شد", "Draw!");
|
||||
subtitle = L("هیچکدام از طرفین برنده نشد", "No side achieved victory");
|
||||
if (S.result_reason === "stalemate") {
|
||||
title = L("پات — مساوی!", "Stalemate — Draw!");
|
||||
subtitle = L("شاه راه حرکتی ندارد", "King has no legal moves");
|
||||
} else if (S.result_reason === "insufficient_material") {
|
||||
title = L("تساوی — عدم کفایت مهرهها", "Draw — Insufficient Material");
|
||||
subtitle = L("مهره کافی برای مات کردن در صفحه وجود ندارد", "Neither side has sufficient pieces to force checkmate");
|
||||
} else {
|
||||
title = L("بازی مساوی شد", "Draw!");
|
||||
subtitle = L("هیچکدام از طرفین برنده نشد", "No side achieved victory");
|
||||
}
|
||||
} else {
|
||||
const winnerName = S.players[S.winner!]?.name;
|
||||
title = `${winnerName} ${L("برنده شد! 🏆", "Wins! 🏆")}`;
|
||||
|
||||
Reference in New Issue
Block a user