mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
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:
parent
b3e7c6b9b2
commit
f6ec583988
9 changed files with 133 additions and 17 deletions
|
|
@ -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 */
|
||||
/* -------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue