Fixed the class name display in the subclass view

This commit is contained in:
WBHarry 2026-05-03 19:13:48 +02:00
parent e28d90fe71
commit 09a6b1480f
3 changed files with 10 additions and 7 deletions

View file

@ -357,7 +357,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
async _createFieldFilter() { async _createFieldFilter() {
const filters = ItemBrowser.getFolderConfig(this.selectedMenu.data, 'filters'); 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); if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field);
else if (typeof f.choices === 'function') { else if (typeof f.choices === 'function') {
f.choices = await f.choices(this.items); f.choices = await f.choices(this.items);

View file

@ -383,7 +383,8 @@ export const typeConfig = {
{ {
key: 'system.linkedClass', key: 'system.linkedClass',
label: 'TYPES.Item.class', 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', key: 'system.spellcastingTrait',
@ -397,7 +398,7 @@ export const typeConfig = {
label: 'TYPES.Item.class', label: 'TYPES.Item.class',
choices: async items => { choices: async items => {
const list = []; 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); const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass);
list.push({ list.push({
value: linkedClass.uuid, value: linkedClass.uuid,

View file

@ -1,8 +1,10 @@
<div class="item-description-outer-container"> <div class="item-description-outer-container">
{{#if spellcastTrait}}
<div class="item-description-container"> <div class="item-description-container">
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}</h4> <h4>{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}</h4>
<span>{{spellcastTrait}}</span> <span>{{spellcastTrait}}</span>
</div> </div>
{{/if}}
<div class="item-description-container"> <div class="item-description-container">
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.foundationFeatures"}}</h4> <h4>{{localize "DAGGERHEART.ITEMS.Subclass.foundationFeatures"}}</h4>
{{#each foundationFeatures as | feature |}} {{#each foundationFeatures as | feature |}}