mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 22:01:54 +02:00
Only highlight checked king
This commit is contained in:
@@ -274,7 +274,7 @@ module.exports = class ChessCommand extends Command {
|
||||
const parsed = this.pickImage(piece);
|
||||
const img = this.images[parsed.color][parsed.name];
|
||||
const { x, y, width, height } = centerImagePart(img, 62, 62, w, h);
|
||||
if ((gameState.check || gameState.checkMate) && piece.toUpperCase() === 'K') {
|
||||
if ((gameState.check || gameState.checkMate) && piece === gameState.turn === 'white' ? 'K' : 'k') {
|
||||
ctx.fillStyle = 'red';
|
||||
ctx.globalAlpha = 0.5;
|
||||
ctx.fillRect(w, h, 62, 62);
|
||||
|
||||
Reference in New Issue
Block a user