WIP
This commit is contained in:
@@ -113,7 +113,7 @@ class Player {
|
|||||||
await this.board.frame(position, this.game.header);
|
await this.board.frame(position, this.game.header);
|
||||||
this.board.render();
|
this.board.render();
|
||||||
|
|
||||||
if (state.boardConfig.speech) {
|
if (this.ply > 0 && state.boardConfig.speech) {
|
||||||
this.speech.say(sanToText(position.move?.san as string));
|
this.speech.say(sanToText(position.move?.san as string));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,6 +128,19 @@ class Player {
|
|||||||
sfx.move.play();
|
sfx.move.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (position.end === 0) {
|
||||||
|
const result = this.game.header.Result;
|
||||||
|
if (result) {
|
||||||
|
this.speech.say(
|
||||||
|
result === "1-0"
|
||||||
|
? "White wins!"
|
||||||
|
: result === "0-1"
|
||||||
|
? "Black wins!"
|
||||||
|
: "Draw"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async first() {
|
async first() {
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ export type BoardConfig = {
|
|||||||
showChecks: boolean;
|
showChecks: boolean;
|
||||||
showCoords: boolean;
|
showCoords: boolean;
|
||||||
showShadows: boolean;
|
showShadows: boolean;
|
||||||
sounds: boolean;
|
sounds?: boolean;
|
||||||
speech: boolean;
|
speech?: boolean;
|
||||||
flipped: boolean;
|
flipped: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user