From 09a6b1480f11c3c642bcb3e329b2d59ab3e7443f Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 3 May 2026 19:13:48 +0200 Subject: [PATCH] Fixed the class name display in the subclass view --- module/applications/ui/itemBrowser.mjs | 2 +- module/config/itemBrowserConfig.mjs | 5 +++-- templates/sheets/items/subclass/description.hbs | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index 4bdc1b31..99b9a23d 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -357,7 +357,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { async _createFieldFilter() { const filters = ItemBrowser.getFolderConfig(this.selectedMenu.data, 'filters'); - for(const f of filters) { + for (const f of filters) { if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field); else if (typeof f.choices === 'function') { f.choices = await f.choices(this.items); diff --git a/module/config/itemBrowserConfig.mjs b/module/config/itemBrowserConfig.mjs index 0bb805b6..3e40c97b 100644 --- a/module/config/itemBrowserConfig.mjs +++ b/module/config/itemBrowserConfig.mjs @@ -383,7 +383,8 @@ export const typeConfig = { { key: 'system.linkedClass', label: 'TYPES.Item.class', - format: linkedClass => linkedClass?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing' + format: linkedClass => + foundry.utils.fromUuidSync(linkedClass)?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing' }, { key: 'system.spellcastingTrait', @@ -397,7 +398,7 @@ export const typeConfig = { label: 'TYPES.Item.class', choices: async items => { const list = []; - for(const item of items.filter(item => item.system.linkedClass)) { + for (const item of items.filter(item => item.system.linkedClass)) { const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass); list.push({ value: linkedClass.uuid, diff --git a/templates/sheets/items/subclass/description.hbs b/templates/sheets/items/subclass/description.hbs index 4591bd1a..0267eb9b 100644 --- a/templates/sheets/items/subclass/description.hbs +++ b/templates/sheets/items/subclass/description.hbs @@ -1,8 +1,10 @@
-
-

{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}

- {{spellcastTrait}} -
+ {{#if spellcastTrait}} +
+

{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}

+ {{spellcastTrait}} +
+ {{/if}}

{{localize "DAGGERHEART.ITEMS.Subclass.foundationFeatures"}}

{{#each foundationFeatures as | feature |}}