diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index 8e51133e..f6235101 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -251,8 +251,14 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { /* If any noticeable slowdown occurs, consider replacing with enriching description on clicking to expand descriptions */ for (const item of this.items) { + if (["weapon", "armor"].includes(item.type)) { + item.system.enrichedTags = await foundry.applications.handlebars.renderTemplate( + 'systems/daggerheart/templates/sheets/global/partials/item-tags.hbs', + item.system, + ); + } item.system.enrichedDescription = - (await item.system.getEnrichedDescription?.({ inCompendium: true })) ?? + (await item.system.getEnrichedDescription?.()) ?? (await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.description)); } diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs index 6eb3042f..0958a9f3 100644 --- a/module/data/item/armor.mjs +++ b/module/data/item/armor.mjs @@ -53,14 +53,14 @@ export default class DHArmor extends AttachableItem { } /**@inheritdoc */ - async getDescriptionData({ inCompendium }) { + async getDescriptionData() { const baseDescription = this.description; const allFeatures = CONFIG.DH.ITEM.allArmorFeatures(); const features = this.armorFeatures.map(x => allFeatures[x.value]).filter(x => x); const prefix = await foundry.applications.handlebars.renderTemplate( 'systems/daggerheart/templates/sheets/items/armor/description.hbs', - { item: this.parent, inCompendium, features } + { item: this.parent, features } ); return { prefix, value: baseDescription, suffix: null }; diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index d40c1ceb..84f39103 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -138,10 +138,10 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { * @param {object} [options] - Options that modify the styling of the rendered template. { headerStyle: undefined|'none'|'large' } * @returns {string} */ - async getEnrichedDescription(options = { inCompendium: false }) { + async getEnrichedDescription() { if (!this.metadata.hasDescription) return ''; - const { prefix, value, suffix } = await this.getDescriptionData(options); + const { prefix, value, suffix } = await this.getDescriptionData(); const fullDescription = [prefix, value, suffix].filter(p => !!p).join('\n
\n'); return await foundry.applications.ux.TextEditor.implementation.enrichHTML(fullDescription, { diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index 9651efda..bb7fde0a 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -109,7 +109,7 @@ export default class DHWeapon extends AttachableItem { } /**@inheritdoc */ - async getDescriptionData({ inCompendium }) { + async getDescriptionData() { const baseDescription = this.description; const allFeatures = CONFIG.DH.ITEM.allWeaponFeatures(); @@ -119,7 +119,6 @@ export default class DHWeapon extends AttachableItem { 'systems/daggerheart/templates/sheets/items/weapon/description.hbs', { item: this, - inCompendium, features } ); diff --git a/styles/less/ui/item-browser/item-browser.less b/styles/less/ui/item-browser/item-browser.less index b395f8c8..2a2e9dac 100644 --- a/styles/less/ui/item-browser/item-browser.less +++ b/styles/less/ui/item-browser/item-browser.less @@ -304,7 +304,19 @@ padding: 0 0 0 50px; display: flex; flex-direction: column; - gap: 5px; + + &:has(.item-tags) { + margin-top: -6px; + } + + .item-description-outer-container:has(div, p) { + margin-top: 8px; + } + + /* Some items don't include an outer container, so we attempt a catch-all */ + > *:last-child { + padding-bottom: 6px; + } h1 { font-size: var(--font-size-32); @@ -350,6 +362,7 @@ .filter-content, .item-desc { display: grid; + opacity: 0; grid-template-rows: 0fr; transition: all 0.3s ease-in-out; width: 100%; @@ -378,8 +391,8 @@ } .expanded + .extensible { + opacity: 1; grid-template-rows: 1fr; - padding-top: 10px; } .welcome-message { diff --git a/templates/ui/itemBrowser/itemContainer.hbs b/templates/ui/itemBrowser/itemContainer.hbs index 0040a692..8dd75156 100644 --- a/templates/ui/itemBrowser/itemContainer.hbs +++ b/templates/ui/itemBrowser/itemContainer.hbs @@ -10,7 +10,10 @@
- {{{system.enrichedDescription}}} + + {{{system.enrichedTags}}} + {{{system.enrichedDescription}}} +
{{/each}} \ No newline at end of file