mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 23:01:54 +00:00
Merge pull request #38 from sajadhsm/confirm-exit
Add confirmation dialog before exiting the game while player is alive
This commit is contained in:
@@ -52,6 +52,12 @@ export class OptionsMenu extends LitElement implements Layer {
|
||||
private hasWinner = false;
|
||||
|
||||
private onExitButtonClick() {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user