[Feature] Item Description Enrichment (#1666)

* Added enrichment for Ancestries and Communities

* Fixed remainder

* Bit of padding

* Increased left padding
This commit is contained in:
WBHarry 2026-02-22 21:32:35 +01:00 committed by GitHub
parent 267de9a8cf
commit 56cc16b39a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 350 additions and 54 deletions

View file

@ -1,3 +1,4 @@
import { getFeaturesHTMLData } from '../../helpers/utils.mjs';
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
import BaseDataItem from './base.mjs';
@ -24,4 +25,17 @@ export default class DHCommunity extends BaseDataItem {
/**@override */
static DEFAULT_ICON = 'systems/daggerheart/assets/icons/documents/items/village.svg';
/**@inheritdoc */
async getDescriptionData() {
const baseDescription = this.description;
const features = await getFeaturesHTMLData(this.features);
if (!features.length) return { prefix: null, value: baseDescription, suffix: null };
const suffix = await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/sheets/items/description.hbs',
{ label: 'DAGGERHEART.ITEMS.Community.featuresLabel', features }
);
return { prefix: null, value: baseDescription, suffix };
}
}