From e3e1395de6f088613dc71472b18e937e9f8e4115 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Wed, 25 Mar 2026 16:36:36 +0100 Subject: [PATCH] Minor ActionConfig improvements --- .../sheets-configs/action-base-config.mjs | 3 +++ module/applications/sheets-configs/action-config.mjs | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/applications/sheets-configs/action-base-config.mjs b/module/applications/sheets-configs/action-base-config.mjs index 7396894f..05a3177d 100644 --- a/module/applications/sheets-configs/action-base-config.mjs +++ b/module/applications/sheets-configs/action-base-config.mjs @@ -318,6 +318,9 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) const type = choices[button.form.elements.type.value].value; const part = this.action.schema.fields.damage.fields.parts.element.getInitialValue(); part.applyTo = type; + if (type === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) + part.type = this.action.schema.fields.damage.fields.parts.element.fields.type.element.initial; + data.damage.parts[type] = part; this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); }; diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index e75e16ab..e15b0391 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -24,15 +24,13 @@ export default class DHActionConfig extends DHActionBaseConfig { const effectData = this._addEffectData.bind(this)(); const data = this.action.toObject(); - const created = await game.system.api.documents.DhActiveEffect.createDialog(effectData, { - parent: this.action.item, - render: false - }); - if (!created) return; + const created = await this.action.item.createEmbeddedDocuments('ActiveEffect', [ + game.system.api.data.activeEffects.BaseEffect.getDefaultObject() + ]); - data.effects.push({ _id: created._id }); + data.effects.push({ _id: created[0]._id }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); - this.action.item.effects.get(created._id).sheet.render(true); + this.action.item.effects.get(created[0]._id).sheet.render(true); } /**