From 126f9180823e2a87de4cf27e73cf75f4657bfd8e Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Thu, 30 Sep 2021 11:10:48 +0200 Subject: [PATCH] Better settings --- src/App.svelte | 16 +- src/components/Modals/BaseModal.svelte | 5 + src/components/Modals/SettingsModal.svelte | 103 ++++++------ src/components/Wrapper.svelte | 4 +- src/shark/Log.ts | 2 +- src/shark/Settings.ts | 183 ++++++++++++++++----- src/shark/SharkGame.ts | 6 +- 7 files changed, 224 insertions(+), 95 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 16eecd7..40c9d3e 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -37,12 +37,18 @@ root = document.documentElement; SharkGame.Settings.subscribe((settings) => { - root.classList.toggle("no-theme", !settings.enableThemes.current); - settings.theme.options.forEach((theme) => { - root.classList.toggle(theme, theme === settings.theme.current); + root.classList.toggle( + "no-theme", + !settings.appearance.enableThemes.current + ); + settings.appearance.theme.options.forEach((theme) => { + root.classList.toggle( + theme, + theme === settings.appearance.theme.current + ); }); - if (settings.updateCheck.current && updateInterval === undefined) { + if (settings.other.updateCheck.current && updateInterval === undefined) { updateInterval = setInterval(async () => { if ( CURRENT_HASH !== undefined && @@ -52,7 +58,7 @@ } }, 6 * 60 * 1000); } else if ( - !settings.updateCheck.current && + !settings.other.updateCheck.current && updateInterval !== undefined ) { clearInterval(updateInterval); diff --git a/src/components/Modals/BaseModal.svelte b/src/components/Modals/BaseModal.svelte index 332fda2..2f577c2 100644 --- a/src/components/Modals/BaseModal.svelte +++ b/src/components/Modals/BaseModal.svelte @@ -53,6 +53,11 @@ padding: 16px; background: var(--color-darker); pointer-events: auto; + + max-width: 80%; + max-height: 80%; + + overflow-y: auto; } } diff --git a/src/components/Modals/SettingsModal.svelte b/src/components/Modals/SettingsModal.svelte index 0db4e58..5b3538a 100644 --- a/src/components/Modals/SettingsModal.svelte +++ b/src/components/Modals/SettingsModal.svelte @@ -1,75 +1,82 @@ - - - - - - - {#each Object.entries($usableSettings) as [settingName, setting] (settingName)} - - - {#each setting.options as option} - - {/each} - - {/each} -
- {setting.name}
- ({setting.description}) -
+ > + {/each} + + {/each} + + {/each} +