summaryrefslogtreecommitdiff
path: root/web/src/lib/ui/menus/SettingsMenu.svelte
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-17 23:12:38 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-17 23:12:38 +0100
commitd64cf3514e5ff1ddb1c7f3ddac9a769db3e7dde0 (patch)
tree781ec9f63220f3c15b309658e9b32ad7d9c70b3a /web/src/lib/ui/menus/SettingsMenu.svelte
parent94e2850fb73005f3fb30af8489905e5cdfb6fac5 (diff)
Phase 5: campaign meta, notes, special rules (M5)
Web: - Note rows: create/edit menu (text, 12-swatch palette, player/monster link with per-standee selection, delete) with the reference's create-vs-edit commit semantics; row rendering with target-derived gradient colour, link indent + connector, standee N:/All: prefixes, tap-to-edit; whole-list drag-to-reorder (reorderList); quick per-figure note (setFigureNote) from the status menu - Special monsters: Ice Wraith "Switch Form" (deck == "Ice Wraith" gate), summon mark toggle (round-green/summon standee artwork, standee-nr badges, per-owner grayscale), character summon boxes + AddSummonMenu (class summons gated by level and standee cap, item summons from summons.json) - Ally deck show/hide in the main menu (shouldShowAlliesDeck gate); settings "clear unlocked" + Special Unlocks menu - AddSectionMenu parity: search filter, findNrFromScenarioName numeric ordering, added sections greyed + no-op, #Random Dungeon label - gameData.ts: SummonModel, ClassData.summons, summons() fetch Server: - unlock_special_command_test (last command without a test; ally-deck hide and remove-sanctuary were already covered) PLAN.md: Phase 5 boxes checked, M5 progress-log entry
Diffstat (limited to 'web/src/lib/ui/menus/SettingsMenu.svelte')
-rw-r--r--web/src/lib/ui/menus/SettingsMenu.svelte63
1 files changed, 60 insertions, 3 deletions
diff --git a/web/src/lib/ui/menus/SettingsMenu.svelte b/web/src/lib/ui/menus/SettingsMenu.svelte
index ef5a91a..4a6699a 100644
--- a/web/src/lib/ui/menus/SettingsMenu.svelte
+++ b/web/src/lib/ui/menus/SettingsMenu.svelte
@@ -1,20 +1,35 @@
<!--
- Settings (Phase 3 subset of the reference `SettingsMenu`): the visual
- style theme and the UI language. Both are client-only preferences.
+ Settings (the reference `SettingsMenu`): the visual style theme and the
+ UI language (client-only preferences), plus the special-unlock controls
+ (the reference `settingsClearUnlocked` / `settingsUnlockSpecials`
+ entries, which are game commands).
-->
<script lang="ts">
+ import type { GameSession } from '$lib/state/session';
import { availableLocales, locale, type Locale } from '$lib/i18n';
import { styleTheme, type StyleTheme } from '$lib/settings';
import { t } from '$lib/i18n';
import Menu from '../Menu.svelte';
+ import SpecialUnlocksMenu from './SpecialUnlocksMenu.svelte';
- let { open = $bindable(true) }: { open?: boolean } = $props();
+ let {
+ session,
+ open = $bindable(true)
+ }: {
+ session: GameSession;
+ open?: boolean;
+ } = $props();
+
+ const player = session.player;
+ const gameState = session.state;
const THEMES: { id: StyleTheme; label: string }[] = [
{ id: 'frosthaven', label: 'Frosthaven' },
{ id: 'gloomhaven', label: 'Gloomhaven' },
{ id: 'original', label: 'Original' }
];
+
+ let unlocksOpen = $state(false);
</script>
<Menu open={open} title={t('menuSettings')}>
@@ -47,4 +62,46 @@
{/each}
</select>
</div>
+
+ <div class="settingsrow settingsrow--btn">
+ <button
+ class="pill"
+ disabled={!$player || !($gameState?.unlockedClasses.length ?? 0)}
+ onclick={() => session.command('clearUnlockedClasses')}
+ >
+ {t('settingsClearUnlocked')}
+ </button>
+ </div>
+ <div class="settingsrow settingsrow--btn">
+ <button class="pill" onclick={() => (unlocksOpen = true)}>
+ {t('settingsUnlockSpecials')}
+ </button>
+ </div>
</Menu>
+
+{#if unlocksOpen}
+ <SpecialUnlocksMenu {session} bind:open={unlocksOpen} />
+{/if}
+
+<style>
+ .settingsrow--btn {
+ justify-content: flex-start;
+ }
+ .pill {
+ padding: 6px 12px;
+ font-size: 13px;
+ border: none;
+ border-radius: 4px;
+ background: rgba(255, 255, 255, 0.12);
+ color: inherit;
+ cursor: pointer;
+ text-align: left;
+ }
+ .pill:hover:not(:disabled) {
+ background: rgba(255, 255, 255, 0.25);
+ }
+ .pill:disabled {
+ opacity: 0.3;
+ cursor: default;
+ }
+</style>