mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
[Feature] Item Description Enrichment (#1666)
* Added enrichment for Ancestries and Communities * Fixed remainder * Bit of padding * Increased left padding
This commit is contained in:
parent
267de9a8cf
commit
56cc16b39a
53 changed files with 350 additions and 54 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import BaseDataItem from './base.mjs';
|
||||
import ItemLinkFields from '../../data/fields/itemLinkFields.mjs';
|
||||
import { getFeaturesHTMLData } from '../../helpers/utils.mjs';
|
||||
|
||||
export default class DHAncestry extends BaseDataItem {
|
||||
/** @inheritDoc */
|
||||
|
|
@ -19,7 +20,6 @@ export default class DHAncestry extends BaseDataItem {
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**@override */
|
||||
|
|
@ -42,4 +42,18 @@ export default class DHAncestry extends BaseDataItem {
|
|||
get secondaryFeature() {
|
||||
return this.features.find(x => x.type === CONFIG.DH.ITEM.featureSubTypes.secondary)?.item;
|
||||
}
|
||||
|
||||
/**@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.Ancestry.featuresLabel', features }
|
||||
);
|
||||
|
||||
return { prefix: null, value: baseDescription, suffix };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue