We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0dd95a4 + 6fa5d69 commit 4e24294Copy full SHA for 4e24294
src/client/ClientGameRunner.ts
@@ -225,6 +225,16 @@ export class ClientGameRunner {
225
this.lastMessageTime = Date.now();
226
}
227
228
+ /**
229
+ * Determines whether window closing should be prevented.
230
+ *
231
+ * Used to show a confirmation dialog when the user attempts to close
232
+ * the window or navigate away during an active game session.
233
234
+ * @returns {boolean} `true` if the window close should be prevented
235
+ * (when the player is alive in the game), `false` otherwise
236
+ * (when the player is not alive or doesn't exist)
237
+ */
238
public shouldPreventWindowClose(): boolean {
239
// Show confirmation dialog if player is alive in the game
240
if (this.myPlayer && this.myPlayer.isAlive()) {
0 commit comments