From 3a8d5285cf1bcdb62fa9c65f6cfba724eb94b6f8 Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Mon, 23 Feb 2026 13:36:41 +0100 Subject: [PATCH] fix (#355): save physical description --- CHANGELOG.md | 6 ++++++ module/data/actor/agent.js | 2 +- module/sheets/agent-sheet.js | 25 ------------------------- module/sheets/base-actor-sheet.js | 2 +- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3e2b2..0001e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ - [#283](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/283) - Added new actor sheet with left hand Sidebar RFC - [#291](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/291) - Moving Luck button from three dots to left hand panel +## Version 1.6.6 - 2026-02-XX + +### **Bug Fixes:** + +- [#355](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/355) - Save the physical description of an agent. + ## Version 1.6.5 - 2026-02-17 ### **Features:** diff --git a/module/data/actor/agent.js b/module/data/actor/agent.js index 222914e..1797bf1 100644 --- a/module/data/actor/agent.js +++ b/module/data/actor/agent.js @@ -30,7 +30,7 @@ export default class AgentData extends CharacterData { }), physical: new SchemaField({ description: new StringField({ - initial: "(Physical description of agent)", + initial: "", }), wounds: new StringField({ initial: "" }), firstAidAttempted: new BooleanField({ initial: false }), diff --git a/module/sheets/agent-sheet.js b/module/sheets/agent-sheet.js index a09b7e2..cd406dd 100644 --- a/module/sheets/agent-sheet.js +++ b/module/sheets/agent-sheet.js @@ -63,31 +63,6 @@ export default class DGAgentSheet extends DGActorSheet { /* -------------------------------------------- */ - /** @override */ - async _prepareContext(options) { - const context = await super._prepareContext(options); - - const enrichedDescription = - await foundry.applications.ux.TextEditor.implementation.enrichHTML( - this.actor.system.physicalDescription, - { - rollData: this.document.getRollData(), - relativeTo: this.document, - }, - ); - const { HTMLProseMirrorElement } = foundry.applications.elements; - context.descriptionField = HTMLProseMirrorElement.create({ - name: "system.physicalDescription", - value: this.actor.system.physicalDescription, - enriched: enrichedDescription, - toggled: true, - }).outerHTML; - - return context; - } - - /* -------------------------------------------- */ - /** * Resets the actor's current breaking point by recalculating it as the difference * between the actor's sanity value and POW value, ensuring it is non-negative, diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index 40deaa7..cac09a2 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -280,7 +280,7 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { switch (this.actor.type) { case "agent": - descriptionPath = "system.physicalDescription"; + descriptionPath = "system.physical.description"; break; case "npc": case "unnatural":