diff --git a/src/hud/sidebar/items.ts b/src/hud/sidebar/items.ts index 1f29ac3..99c46c9 100644 --- a/src/hud/sidebar/items.ts +++ b/src/hud/sidebar/items.ts @@ -50,6 +50,8 @@ class PF2eHudSidebarItems extends PF2eHudSidebar { }, }; + console.log(inventoryData); + return data; } @@ -174,6 +176,10 @@ async function openCarryTypeMenu(actor: CharacterPF2e, anchor: HTMLElement): Pro } function getItemFilter(itemData: SidebarItem): string { + if (itemData.item.subitems.size) { + return `${itemData.item.name} ` + itemData.item.subitems.map((x) => x.name).join(" "); + } + if (!itemData.heldItems?.length) return itemData.item.name; itemData.heldItems = itemData.heldItems.map((x) => { @@ -181,7 +187,7 @@ function getItemFilter(itemData: SidebarItem): string { return x; }); - return itemData.heldItems.map((x) => x.filterValue).join(" "); + return `${itemData.item.name} ` + itemData.heldItems.map((x) => x.filterValue).join(" "); } type SidebarItem = Omit & { diff --git a/templates/sidebars/items.hbs b/templates/sidebars/items.hbs index 58c98ae..7f39dee 100644 --- a/templates/sidebars/items.hbs +++ b/templates/sidebars/items.hbs @@ -42,7 +42,7 @@
+ {{/if}} draggable="true" data-filter-value="{{ifThen isSubitem item.name filterValue}}"> {{!-- subspacer --}} {{#if (or item.isInContainer isSubitem)}} {{#if (and item.isInContainer isContainer)}}