Skip to content

Commit

Permalink
feat(item sheet): enrichment of item descriptions
Browse files Browse the repository at this point in the history
this is useful for catch roll data and general references of documents in item description
  • Loading branch information
SouOWendel committed Nov 21, 2024
1 parent 379dc47 commit 220e974
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions module/sheets/item-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class OrdemItemSheet extends ItemSheet {
rollData: this.item.getRollData(),
flags: itemData.flags,
effects: prepareActiveEffectCategories(this.item.effects),

// Armament's Dropdowns
optionWeaponType: CONFIG.op.dropdownWeaponType,
optionWeaponSubType: CONFIG.op.dropdownWeaponSubType,
Expand All @@ -68,19 +67,26 @@ export class OrdemItemSheet extends ItemSheet {
optionResistance: CONFIG.op.dropdownResistance,
optionSkillResis: CONFIG.op.dropdownSkillResis,
optionElement: CONFIG.op.dropdownElement,

// Attack and Damage Dropdown
attributes: CONFIG.op.attributes,
attackSkills: CONFIG.op.attackSkills,

// Ritual's Dropdowns
optionExecution: CONFIG.op.dropdownExecution,

// Item's Radiobox
categories: CONFIG.op.categories,
degree: CONFIG.op.ritualDegree,
});

const enrichmentOptions = {
secrets: this.item.isOwner,
relativeTo: this.item,
rollData: context.rollData
};

context.enriched = {
description: await TextEditor.enrichHTML(context.system.description ?? '', enrichmentOptions)
};

// https://foundryvtt.com/api/classes/foundry.abstract.Document.html#updateDocuments
// https://foundryvtt.com/api/classes/foundry.abstract.Document.html#deleteDocuments

Expand Down

0 comments on commit 220e974

Please sign in to comment.