diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d17a40f..608390f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -20,4 +20,7 @@ module.exports = { es2021: true, node: false, }, + rules: { + "@typescript-eslint/no-unused-vars": ["warn", { args: "all", argsIgnorePattern: "^_", ignoreRestSiblings: false }], + }, }; diff --git a/src/App.svelte b/src/App.svelte index 39f1a87..bbb658c 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -14,7 +14,7 @@ onMount(() => { root = document.documentElement; - SharkGame.Settings.settings.subscribe((settings) => { + SharkGame.SettingsHandler.settings.subscribe((settings) => { root.classList.toggle("no-theme", !settings.appearance.enableThemes.current); settings.appearance.theme.options.forEach((theme) => { root.classList.toggle(theme, theme === settings.appearance.theme.current); @@ -33,12 +33,6 @@ } function handleBeforeUnload(event: BeforeUnloadEvent) { - console.debug( - "beforeUnload", - Date.now() - SharkGame.SaveHandler.lastSaved >= 60 * 1000, - Date.now() - SharkGame.SaveHandler.lastSaved, - 60 * 1000 - ); // If last save is over a minute old if (Date.now() - SharkGame.SaveHandler.lastSaved >= 60 * 1000) { // Annotyingly, the standardized way isn't supported, so both outdated ones will have to suffice diff --git a/src/components/Header.svelte b/src/components/Header.svelte index ad8de7c..8c53be0 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -16,7 +16,7 @@ return game.SaveHandler.save(game); }, settings() { - openModal(SettingsModal, { settings: game.Settings.settings }, { replace: true }); + openModal(SettingsModal, { settings: game.SettingsHandler.settings }, { replace: true }); }, help() { openModal(HelpModal, { discordLink }, { replace: true }); diff --git a/src/components/Log.svelte b/src/components/Log.svelte index 2ae3a06..6883fe5 100644 --- a/src/components/Log.svelte +++ b/src/components/Log.svelte @@ -6,8 +6,8 @@ import type { Writable } from "svelte/store"; import { slide } from "svelte/transition"; - import type { AddMessageEvent, ResetLogEvent, Message } from "../shark/Message"; - import { MessageType } from "../shark/Message"; + import type { AddMessageEvent, ResetLogEvent, Message } from "../shark/helperTypes/Message"; + import { MessageType } from "../shark/helperTypes/Message"; export let messages: Writable; export let logLength: number; diff --git a/src/components/Modals/ResetModal.svelte b/src/components/Modals/ResetModal.svelte index 969f604..df53d2d 100644 --- a/src/components/Modals/ResetModal.svelte +++ b/src/components/Modals/ResetModal.svelte @@ -12,7 +12,7 @@ { - game.SaveHandler.reset(); + game.SaveHandler.resetSave(); }} deny={closeAllModals}>Do you want to reset your save? diff --git a/src/components/Modals/SettingsModal.svelte b/src/components/Modals/SettingsModal.svelte index 630c3cd..96e35ac 100644 --- a/src/components/Modals/SettingsModal.svelte +++ b/src/components/Modals/SettingsModal.svelte @@ -1,11 +1,11 @@ diff --git a/src/components/ResourceTable/ResourceGroup.svelte b/src/components/ResourceTable/ResourceGroup.svelte index ca2a6c2..55163a9 100644 --- a/src/components/ResourceTable/ResourceGroup.svelte +++ b/src/components/ResourceTable/ResourceGroup.svelte @@ -1,11 +1,11 @@ @@ -13,9 +13,9 @@

{categoryName}

{#if !collapsed} - {#each resources as [resourceName, resource], index} - - {resourceName} + {#each resources as resource, index} + + {resource.humanName} {resource.amount} {Math.round(100 * (resource.change + Number.EPSILON)) / 100}/s @@ -30,8 +30,12 @@ background-color: var(--color-lighter); } + text-shadow: -1px -1px 2px var(--color-med), 1px -1px 2px var(--color-med), -1px 1px 2px var(--color-med), + 1px 1px 2px var(--color-med); + > td:first-child { text-align: left; + color: var(--resource-color); } > td { padding: 2px 5px; diff --git a/src/components/ResourceTable/ResourceTable.svelte b/src/components/ResourceTable/ResourceTable.svelte index 0366929..92f649e 100644 --- a/src/components/ResourceTable/ResourceTable.svelte +++ b/src/components/ResourceTable/ResourceTable.svelte @@ -3,7 +3,7 @@