mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 17:02:27 +00:00
only display exit confirmation while player is alive
This commit is contained in:
@@ -52,11 +52,13 @@ export class OptionsMenu extends LitElement implements Layer {
|
||||
private hasWinner = false;
|
||||
|
||||
private onExitButtonClick() {
|
||||
const isConfirmed = confirm("Are you sure you want to exit the game?");
|
||||
|
||||
if (isConfirmed) {
|
||||
window.location.reload();
|
||||
const isAlive = this.game.myPlayer()?.isAlive();
|
||||
if (isAlive) {
|
||||
const isConfirmed = confirm("Are you sure you want to exit the game?");
|
||||
if (!isConfirmed) return;
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
createRenderRoot() {
|
||||
|
||||
Reference in New Issue
Block a user