From d64cf3514e5ff1ddb1c7f3ddac9a769db3e7dde0 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 17 Nov 2026 23:12:38 +0100 Subject: 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 --- web/src/lib/ui/StatusMenu.svelte | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) (limited to 'web/src/lib/ui/StatusMenu.svelte') diff --git a/web/src/lib/ui/StatusMenu.svelte b/web/src/lib/ui/StatusMenu.svelte index 46f6325..e968883 100644 --- a/web/src/lib/ui/StatusMenu.svelte +++ b/web/src/lib/ui/StatusMenu.svelte @@ -21,7 +21,9 @@ import { isObjectiveOrEscort } from '$lib/data/classInfo'; import { CONDITIONS } from '$lib/game/conditions'; import { t } from '$lib/i18n'; + import type { CampaignData } from '$lib/data/gameData'; import Menu from './Menu.svelte'; + import FigureNoteMenu from './menus/FigureNoteMenu.svelte'; export interface FigureRef { title: string; @@ -38,10 +40,16 @@ let { session, figure, + campaignData, + onAddNoteRow, open = $bindable(true) }: { session: GameSession; figure: FigureRef; + /** Campaign data (monster model lookup for the Ice Wraith gate). */ + campaignData?: CampaignData | null; + /** Open the note-row editor with a preset link target. */ + onAddNoteRow: (presetLinkId: string) => void; open?: boolean; } = $props(); @@ -131,6 +139,62 @@ if (conditions.includes(index)) cmd('removeCondition', args); else cmd('addCondition', args); } + + // --- Phase 5 extras ------------------------------------------------------ + + /** The owning monster's model (Ice Wraith gate), for monster figures. */ + const monsterModel = $derived.by(() => { + if (figure.kind !== 'monster' || !campaignData) return null; + const owner = liveOwner; + if (owner == null || !('monsterInstances' in owner)) return null; + return ( + campaignData.monsters.find( + (m) => m.name === owner.type || m.display === owner.type + ) ?? null + ); + }); + + const isIceWraith = $derived(monsterModel?.deck === 'Ice Wraith'); + const isElite = $derived(liveStandee?.type === 1); + + function switchForm() { + // The command takes the *current* elite state and toggles it. + cmd('iceWraithChangeForm', { + isElite, + ownerId: figure.ownerId ?? '', + figureId: figure.figureId + }); + } + + // The summon mark (the reference `StatusMenuSummonButton`). + const summonMarked = $derived(liveStandee?.roundSummoned !== -1); + + function toggleSummon() { + cmd('setAsSummon', { + summoned: !summonMarked, + figureId: figure.figureId, + ownerId: figure.ownerId ?? '' + }); + } + + // The figure's quick note (characters and monsters; not summons). + const noteFigure = $derived.by(() => { + if (figure.kind === 'character') return liveCharacter; + if (figure.kind === 'monster') + return liveOwner && 'note' in liveOwner ? liveOwner : null; + return null; + }); + + let noteOpen = $state(false); + + function openNote() { + noteOpen = true; + } + + /** The link target preset when adding a note row from here. */ + function presetLinkTarget(): string { + return figure.ownerId ?? figure.figureId; + } @@ -197,6 +261,48 @@ {/each} +
+ {#if isIceWraith} + + {/if} + {#if figure.kind === 'monster' && liveStandee} + + {/if} + {#if noteFigure} + + {/if} + +
+ {#if roundState === 1}
+ +{#if noteOpen && noteFigure} + +{/if} -- cgit v1.3.1