diff --git a/src/App.svelte b/src/App.svelte
index 4652ecd..e313ddf 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -4,7 +4,7 @@
import Wrapper from "./components/Wrapper.svelte";
import { SharkGame } from "./shark/SharkGame";
- import { Modals, closeModal } from "svelte-modals";
+ import { Modals, closeAllModals } from "svelte-modals";
import { onDestroy, onMount } from "svelte";
import type { Unsubscriber } from "svelte/store";
@@ -28,7 +28,7 @@
function handleKeyUp(event: KeyboardEvent) {
if (event.key === "Escape") {
- closeModal();
+ closeAllModals();
}
}
@@ -36,7 +36,7 @@
-
+
{#await SharkGame.initialize()}
Loading...
diff --git a/src/components/Header.svelte b/src/components/Header.svelte
index 1c5f366..3d5de22 100644
--- a/src/components/Header.svelte
+++ b/src/components/Header.svelte
@@ -4,6 +4,7 @@
import SettingsModal from "./Modals/SettingsModal.svelte";
import HelpModal from "./Modals/HelpModal.svelte";
+ import ResetModal from "./Modals/ResetModal.svelte";
export let title: string;
export let game: typeof SharkGame;
@@ -21,7 +22,7 @@
openModal(HelpModal, { discordLink }, { replace: true });
},
reset() {
- console.log("reset");
+ openModal(ResetModal, { game }, { replace: true });
},
};
const otherHeaderButtons = {
diff --git a/src/components/Modals/Base/ConfirmModal.svelte b/src/components/Modals/Base/ConfirmModal.svelte
new file mode 100644
index 0000000..60c09b1
--- /dev/null
+++ b/src/components/Modals/Base/ConfirmModal.svelte
@@ -0,0 +1,20 @@
+
+
+
+
+
Are you sure?
+
+
+
+
+
+
diff --git a/src/components/Modals/BaseModal.svelte b/src/components/Modals/Base/Modal.svelte
similarity index 100%
rename from src/components/Modals/BaseModal.svelte
rename to src/components/Modals/Base/Modal.svelte
diff --git a/src/components/Modals/HelpModal.svelte b/src/components/Modals/HelpModal.svelte
index d0bf4ce..3b721bd 100644
--- a/src/components/Modals/HelpModal.svelte
+++ b/src/components/Modals/HelpModal.svelte
@@ -1,5 +1,5 @@
+
+ {
+ game.SaveHandler.reset();
+ }}
+ deny={closeAllModals}>Do you want to reset your save?
diff --git a/src/components/Modals/SettingsModal.svelte b/src/components/Modals/SettingsModal.svelte
index 33f8e3b..630c3cd 100644
--- a/src/components/Modals/SettingsModal.svelte
+++ b/src/components/Modals/SettingsModal.svelte
@@ -1,7 +1,7 @@