FIX: Add enritch to HTMLField

FIX: Remove no-HTMLField from Manifest
FIX: Convert Scar's HTMLField to StringField
FIX: Remove unused HTMLField
This commit is contained in:
Joaquin Pereyra 2025-07-09 13:53:24 -03:00
parent b3e7c6b9b2
commit f6ec583988
9 changed files with 133 additions and 17 deletions

View file

@ -160,18 +160,64 @@ export default class CharacterSheet extends DHBaseActorSheet {
case 'sidebar':
await this._prepareSidebarContext(context, options);
break;
case 'biography':
await this._prepareBiographyContext(context, options);
break;
}
return context;
}
/**
* Prepare render context for the Loadout part.
* @param {ApplicationRenderContext} context
* @param {ApplicationRenderOptions} options
* @returns {Promise<void>}
* @protected
*/
async _prepareLoadoutContext(context, _options) {
context.listView = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.displayDomainCardsAsList);
}
/**
* Prepare render context for the Sidebar part.
* @param {ApplicationRenderContext} context
* @param {ApplicationRenderOptions} options
* @returns {Promise<void>}
* @protected
*/
async _prepareSidebarContext(context, _options) {
context.isDeath = this.document.system.deathMoveViable;
}
/**
* Prepare render context for the Biography part.
* @param {ApplicationRenderContext} context
* @param {ApplicationRenderOptions} options
* @returns {Promise<void>}
* @protected
*/
async _prepareBiographyContext(context, _options) {
const { system } = this.document;
const { TextEditor } = foundry.applications.ux;
const paths = {
background: 'biography.background',
connections: 'biography.connections'
};
for (const [key, path] of Object.entries(paths)) {
const value = foundry.utils.getProperty(system, path);
context[key] = {
field: system.schema.getField(path),
value,
enriched: await TextEditor.implementation.enrichHTML(value, {
secrets: this.document.isOwner,
relativeTo: this.document
})
};
}
}
/* -------------------------------------------- */
/* Context Menu */
/* -------------------------------------------- */