diff --git a/lang/en.json b/lang/en.json
index 60753d50..a78ed588 100755
--- a/lang/en.json
+++ b/lang/en.json
@@ -2055,6 +2055,7 @@
"partyMembers": "Party Members",
"projects": "Projects",
"types": "Types",
+ "itemFeatures": "Item Features",
"questions": "Questions",
"configuration": "Configuration",
"base": "Base"
diff --git a/module/applications/sheets/api/base-item.mjs b/module/applications/sheets/api/base-item.mjs
index e3568b23..00448e95 100644
--- a/module/applications/sheets/api/base-item.mjs
+++ b/module/applications/sheets/api/base-item.mjs
@@ -79,7 +79,9 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
switch (partId) {
case 'description':
- context.enrichedDescription = await this.document.system.getEnrichedDescription();
+ context.enrichedDescription = await this.document.system.getEnrichedDescription({
+ headerStyle: 'large'
+ });
break;
case 'effects':
await this._prepareEffectsContext(context, options);
diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs
index 3d4a62fa..c0de0eeb 100644
--- a/module/data/item/armor.mjs
+++ b/module/data/item/armor.mjs
@@ -55,18 +55,19 @@ export default class DHArmor extends AttachableItem {
}
/**@inheritdoc */
- async getDescriptionData() {
- const baseDescription = this.description;
+ async getDescriptionData(options = {}) {
+ const baseDescription = await super.getDescriptionData();
const allFeatures = CONFIG.DH.ITEM.allArmorFeatures();
const features = this.armorFeatures.map(x => allFeatures[x.value]);
- if (!features.length) return { prefix: null, value: baseDescription, suffix: null };
+ if (!features.length) return baseDescription;
- const prefix = await foundry.applications.handlebars.renderTemplate(
+ const prepend = await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/sheets/items/armor/description.hbs',
- { features }
+ { features, headerStyle: options.headerStyle }
);
- return { prefix, value: baseDescription, suffix: null };
+ const mainDescription = baseDescription ? `\n
\n${baseDescription}` : '';
+ return `${prepend}${mainDescription}`;
}
/**@inheritdoc */
diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs
index f0c840eb..c98631cb 100644
--- a/module/data/item/base.mjs
+++ b/module/data/item/base.mjs
@@ -130,7 +130,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
* @returns {string}
*/
async getDescriptionData(_options) {
- return { prefix: null, value: this.description, suffix: null };
+ return this.description;
}
/**
@@ -138,13 +138,11 @@ 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() {
+ async getEnrichedDescription(options) {
if (!this.metadata.hasDescription) return '';
- 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, {
+ const description = await this.getDescriptionData(options);
+ return await foundry.applications.ux.TextEditor.implementation.enrichHTML(description, {
relativeTo: this,
rollData: this.getRollData(),
secrets: this.isOwner
diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs
index f333e5f3..48a53e02 100644
--- a/module/data/item/weapon.mjs
+++ b/module/data/item/weapon.mjs
@@ -111,18 +111,19 @@ export default class DHWeapon extends AttachableItem {
}
/**@inheritdoc */
- async getDescriptionData() {
- const baseDescription = this.description;
+ async getDescriptionData(options = {}) {
+ const baseDescription = await super.getDescriptionData();
const allFeatures = CONFIG.DH.ITEM.allWeaponFeatures();
const features = this.weaponFeatures.map(x => allFeatures[x.value]);
- if (!features.length) return { prefix: null, value: baseDescription, suffix: null };
+ if (!features.length) return baseDescription;
- const prefix = await foundry.applications.handlebars.renderTemplate(
+ const prepend = await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/sheets/items/weapon/description.hbs',
- { features }
+ { features, headerStyle: options.headerStyle }
);
- return { prefix, value: baseDescription, suffix: null };
+ const mainDescription = baseDescription ? `\n
\n${baseDescription}` : '';
+ return `${prepend}${mainDescription}`;
}
prepareDerivedData() {
diff --git a/module/documents/tooltipManager.mjs b/module/documents/tooltipManager.mjs
index dac5aea3..b25a4b21 100644
--- a/module/documents/tooltipManager.mjs
+++ b/module/documents/tooltipManager.mjs
@@ -221,14 +221,15 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
const itemIsAction = itemValue instanceof game.system.api.models.actions.actionsTypes.base;
const value = itemIsAction || !itemValue?.item ? itemValue : itemValue.item;
const enrichedValue =
- (await value.system?.getEnrichedDescription?.()) ??
+ (await value.system?.getEnrichedDescription?.({ headerStyle: 'none' })) ??
(await TextEditor.enrichHTML(value.system?.description ?? value.description));
if (itemIsAction) value.enrichedDescription = enrichedValue;
else foundry.utils.setProperty(item, `${basePath}.${index}.enrichedDescription`, enrichedValue);
}
} else {
const enrichedValue =
- (await item.system?.getEnrichedDescription?.()) ?? (await TextEditor.enrichHTML(pathValue));
+ (await item.system?.getEnrichedDescription?.({ headerStyle: 'none' })) ??
+ (await TextEditor.enrichHTML(pathValue));
foundry.utils.setProperty(
item,
`${data.path ? `${data.path}.` : ''}enriched${data.name.capitalize()}`,
diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less
index c8a29795..a17e2b35 100644
--- a/styles/less/global/inventory-item.less
+++ b/styles/less/global/inventory-item.less
@@ -211,6 +211,18 @@
ul {
list-style: disc;
}
+
+ .feature-descriptions {
+ .features-header {
+ font-size: 14px;
+ font-weight: bold;
+ text-decoration: underline;
+
+ &.large {
+ font-size: 18px;
+ }
+ }
+ }
}
}
.item-resources {
diff --git a/styles/less/sheets/items/item-sheet-shared.less b/styles/less/sheets/items/item-sheet-shared.less
index d0a8cc48..54b9c8c2 100644
--- a/styles/less/sheets/items/item-sheet-shared.less
+++ b/styles/less/sheets/items/item-sheet-shared.less
@@ -10,4 +10,16 @@
font-family: @font-body;
color: light-dark(@chat-blue-bg, @beige-50);
}
+
+ .feature-descriptions {
+ .features-header {
+ font-size: 14px;
+ font-weight: bold;
+ text-decoration: underline;
+
+ &.large {
+ font-size: 18px;
+ }
+ }
+ }
}
diff --git a/templates/sheets/items/armor/description.hbs b/templates/sheets/items/armor/description.hbs
index c5a9924e..d2c67604 100644
--- a/templates/sheets/items/armor/description.hbs
+++ b/templates/sheets/items/armor/description.hbs
@@ -1,4 +1,7 @@
-
+
+ {{#unless (eq headerStyle 'none')}}
+
+ {{/unless}}
{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}}
diff --git a/templates/sheets/items/weapon/description.hbs b/templates/sheets/items/weapon/description.hbs
index c5a9924e..d2c67604 100644
--- a/templates/sheets/items/weapon/description.hbs
+++ b/templates/sheets/items/weapon/description.hbs
@@ -1,4 +1,7 @@
-
+
+ {{#unless (eq headerStyle 'none')}}
+
+ {{/unless}}
{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}}