diff --git a/src/components/spellbook/SpellbookList.svelte b/src/components/spellbook/SpellbookList.svelte index 23f6d2e75..9e64d6c80 100644 --- a/src/components/spellbook/SpellbookList.svelte +++ b/src/components/spellbook/SpellbookList.svelte @@ -34,6 +34,7 @@ import ClassicControls from 'src/sheets/shared/ClassicControls.svelte'; import ConcentrationOverlayIcon from './ConcentrationOverlayIcon.svelte'; import DeleteOrOpenActivity from '../item-list/controls/DeleteOrOpenActivity.svelte'; + import ActivityUses from '../item-list/ActivityUses.svelte'; let context = getContext>( CONSTANTS.SVELTE_CONTEXT.CONTEXT, @@ -206,6 +207,10 @@ + {:else if (spell.system.linkedActivity?.uses?.max ?? 0) > 0} + + + {/if} {#if allowFavorites && $settingStore.showIconsNextToTheItemName && 'favoriteId' in ctx && !!ctx.favoriteId} diff --git a/src/features/sections/SheetSections.ts b/src/features/sections/SheetSections.ts index f8cff4163..27c2491be 100644 --- a/src/features/sections/SheetSections.ts +++ b/src/features/sections/SheetSections.ts @@ -135,7 +135,14 @@ export class SheetSections { const spellbookMap = spellbook.reduce>( (prev, curr) => { - const key = curr.prop ?? ''; + let key = curr.prop ?? ''; + + // Handle "Additional Spells" section + if (curr.order === 'item') { + key = 'dnd5e-cast-activity-additional-spells'; + curr.canCreate = false; + } + curr.key = key; // Tidy passes the dataset directly to the item creation code, rather than planting it on the HTML. diff --git a/src/mixins/SvelteApplicationMixin.ts b/src/mixins/SvelteApplicationMixin.ts index f2d7ae2d9..a4b9a22cf 100644 --- a/src/mixins/SvelteApplicationMixin.ts +++ b/src/mixins/SvelteApplicationMixin.ts @@ -457,7 +457,7 @@ export function SvelteApplicationMixin< this.#focusedInputSelector = focusedElement?.name ? `${focusedElement.tagName}[name="${focusedElement.name}"]` : focusedElement?.id - ? `#${focusedElement.id}` + ? `[id="${focusedElement.id}"]` : undefined; } diff --git a/src/sheets/item/parts/FieldUses.svelte b/src/sheets/item/parts/FieldUses.svelte index fa55778eb..f14580306 100644 --- a/src/sheets/item/parts/FieldUses.svelte +++ b/src/sheets/item/parts/FieldUses.svelte @@ -181,7 +181,7 @@ ev.currentTarget.value, )} disabled={!$context.editable} - value={recovery.data.formula} + value={recovery.data.formula ?? ''} /> {/if} diff --git a/src/types/types.ts b/src/types/types.ts index 81f14bfb5..b0d738a23 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -184,7 +184,7 @@ export type SimpleEditableColumn = { }; export type SpellbookSection = { - order?: number; + order?: number | string; usesSlots: boolean; canCreate: boolean; canPrepare: boolean;