главный экран
This commit is contained in:
@@ -53,3 +53,17 @@ export function writeSave(data: SaveData): void {
|
||||
// Ignore — e.g. private browsing mode or quota exceeded.
|
||||
}
|
||||
}
|
||||
|
||||
/** Deletes the saved game, if any — used when starting a brand new game. */
|
||||
export function clearSave(): void {
|
||||
try {
|
||||
localStorage.removeItem(STORAGE_KEY);
|
||||
} catch {
|
||||
// Ignore — e.g. private browsing mode.
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether a valid, resumable save currently exists (used to enable/disable "Continue" in the menu). */
|
||||
export function hasSave(): boolean {
|
||||
return loadSave() !== null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user