|
|
@ -454,11 +454,11 @@ const impossibleDialog = (sum) => { |
|
|
|
}]} |
|
|
|
}]} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const gameOverDialog = (winner, points) => { |
|
|
|
const gameOverDialog = (winner, points, breaks) => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
"withshortkey": true, |
|
|
|
"withshortkey": true, |
|
|
|
"title": `Game Over`, |
|
|
|
"title": `Game Over`, |
|
|
|
"text": `${winner != "DRAW" ? "The winner is": ""} ${winner} with ${points[0]}-${points[1]}`, |
|
|
|
"text": `${winner != "DRAW" ? "The winner is": ""} ${winner} with ${points[0]}-${points[1]} (Breaks: ${breaks[0]}-${breaks[1]})`, |
|
|
|
"buttons": [ |
|
|
|
"buttons": [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
"component": "d-plainElem", |
|
|
|
"component": "d-plainElem", |
|
|
@ -650,7 +650,7 @@ const gameStateMachine = (gamestack, stack, page, computedProps) => { |
|
|
|
if (winner != -2){ |
|
|
|
if (winner != -2){ |
|
|
|
name = page.players[winner].forename; |
|
|
|
name = page.players[winner].forename; |
|
|
|
} |
|
|
|
} |
|
|
|
const [answer, error] = await overlayAndPop("d-dialog", gameOverDialog(name, points[1]), stack); |
|
|
|
const [answer, error] = await overlayAndPop("d-dialog", gameOverDialog(name, points[1], computedProps.breaks.value), stack); |
|
|
|
if (answer == "end") { |
|
|
|
if (answer == "end") { |
|
|
|
saveGame(page); |
|
|
|
saveGame(page); |
|
|
|
return [undefined, page.stats.winner]; |
|
|
|
return [undefined, page.stats.winner]; |
|
|
|