diff --git a/src/lib/components/units/CharacterUnit.svelte b/src/lib/components/units/CharacterUnit.svelte index 334daec3..8eb5dc0c 100644 --- a/src/lib/components/units/CharacterUnit.svelte +++ b/src/lib/components/units/CharacterUnit.svelte @@ -1,16 +1,23 @@ -
- {item -
{item ? displayName(item.object) : '—'}
- {#if ctx.canEdit() && !item} - - {/if} - {#if ctx.canEdit() && item?.id} -
- - +
+ {#key (item ? (item as any).id ?? position : `empty-${position}`)} +
ctx?.openPicker && ctx.openPicker({ type: 'character', position, item })} + > + {item + {#if !item && ctx?.canEdit()} + + + + {/if} + {#if ctx.canEdit() && item?.id} +
+ +
+ {/if}
- {/if} - {#if ctx.canEdit() && item?.id} - - {/if} + {/key} +
{item ? displayName(item?.character || (item as any)?.object) : ''}
diff --git a/src/lib/components/units/SummonUnit.svelte b/src/lib/components/units/SummonUnit.svelte index f36b2537..5c4643bc 100644 --- a/src/lib/components/units/SummonUnit.svelte +++ b/src/lib/components/units/SummonUnit.svelte @@ -1,14 +1,21 @@ -
- {item -
{item ? displayName(item.object) : '—'}
- {#if ctx.canEdit() && !item} - - {/if} - {#if ctx.canEdit() && item?.id} -
- - +
+ {#key (item ? (item as any).id ?? position : `empty-${position}`)} +
ctx?.openPicker && ctx.openPicker({ type: 'summon', position, item })} + > + {item + {#if !item && ctx?.canEdit()} + + + + {/if} + {#if ctx.canEdit() && item?.id} +
+ +
+ {/if} + {#if item?.main || position === -1} + Main + {/if} + {#if item?.friend || position === 6} + Friend + {/if}
- {/if} - {#if ctx.canEdit() && item?.id} - - {/if} - {#if item?.main || position === -1} - Main - {/if} - {#if item?.friend || position === 6} - Friend - {/if} + {/key} +
{item ? displayName(item?.summon || (item as any)?.object) : ''}
diff --git a/src/lib/components/units/WeaponUnit.svelte b/src/lib/components/units/WeaponUnit.svelte index 9d9c9d79..43a2aa05 100644 --- a/src/lib/components/units/WeaponUnit.svelte +++ b/src/lib/components/units/WeaponUnit.svelte @@ -1,14 +1,21 @@ -
- {item -
{item ? displayName(item.object) : '—'}
- {#if ctx.canEdit() && !item} - - {/if} - {#if ctx.canEdit() && item?.id} -
- - +
+ {#key (item ? (item as any).id ?? position : `empty-${position}`)} +
ctx?.openPicker && ctx.openPicker({ type: 'weapon', position, item })} + > + {item + {#if !item && ctx?.canEdit()} + + + + {/if} + {#if ctx.canEdit() && item?.id} +
+ +
+ {/if} + {#if item?.mainhand || position === -1} + Main + {/if}
- {/if} - {#if (item as any)?.mainhand || position === -1} - Main - {/if} + {/key} +
{item ? displayName(item?.weapon || (item as any)?.object) : ''}