[Feature] Armor/Weapon Features In Description (#1521)

* ItemFeatures are now prepended to the description

* .

* Better separation of concerns

* .

* .
This commit is contained in:
WBHarry 2026-01-12 14:16:19 +01:00 committed by GitHub
parent 8de12551ad
commit 883aaeec02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 84 additions and 20 deletions

View file

@ -220,12 +220,15 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
for (const [index, itemValue] of pathValue.entries()) {
const itemIsAction = itemValue instanceof game.system.api.models.actions.actionsTypes.base;
const value = itemIsAction || !itemValue?.item ? itemValue : itemValue.item;
const enrichedValue = await TextEditor.enrichHTML(value.system?.description ?? value.description);
const enrichedValue =
(await value.system?.getEnrichedDescription?.()) ??
(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 TextEditor.enrichHTML(pathValue);
const enrichedValue =
(await item.system?.getEnrichedDescription?.()) ?? (await TextEditor.enrichHTML(pathValue));
foundry.utils.setProperty(
item,
`${data.path ? `${data.path}.` : ''}enriched${data.name.capitalize()}`,