diff --git a/module/applications/sheets/items/subclass.mjs b/module/applications/sheets/items/subclass.mjs index 254ab7cc..6daf4a89 100644 --- a/module/applications/sheets/items/subclass.mjs +++ b/module/applications/sheets/items/subclass.mjs @@ -44,9 +44,9 @@ export default class SubclassSheet extends DHBaseItemSheet { async _prepareContext(options) { const context = await super._prepareContext(options); if (this.document.system.linkedClass) { - context.class = (await fromUuid(this.document.system.linkedClass)) ?? { + const classData = await fromUuid(this.document.system.linkedClass); + context.class = classData ?? { name: _loc('DAGGERHEART.GENERAL.missingX', { x: _loc('TYPES.Item.class') }), - img: 'systems/daggerheart/assets/icons/documents/items/laurel-crown.svg', missing: true }; } 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/styles/less/global/feature-section.less b/styles/less/global/feature-section.less index 937f0cde..7d5099e1 100644 --- a/styles/less/global/feature-section.less +++ b/styles/less/global/feature-section.less @@ -35,6 +35,14 @@ border-radius: 6px; border: none; } + .image-icon { + font-size: 26px; + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + } .controls { display: flex; justify-content: center; 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 |}} diff --git a/templates/sheets/items/subclass/features.hbs b/templates/sheets/items/subclass/features.hbs index 75ff3a8b..c54e702e 100644 --- a/templates/sheets/items/subclass/features.hbs +++ b/templates/sheets/items/subclass/features.hbs @@ -8,9 +8,12 @@ {{#if class}}
  • - - {{class.name}} {{#if class.missing}}{{/if}} - {{#unless class.missing}} + {{#if class.missing}} + + {{class.name}} + {{else}} + + {{class.name}} - {{/unless}} + {{/if}}
  • {{else}}