From 87879c1f279f9df977a18f8ccd40f8a391f561b8 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Mon, 10 Nov 2025 09:27:46 +0100 Subject: [PATCH] . --- module/config/generalConfig.mjs | 15 ++++++++++----- module/data/fields/action/damageField.mjs | 9 ++++----- styles/less/hud/token-hud/token-hud.less | 6 ++++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 8f889bf0..1f09b748 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -166,11 +166,16 @@ export const healingTypes = { export const defeatedConditions = () => { const defeated = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).defeated; - return Object.values(defeatedConditionChoices).map(x => ({ - ...x, - img: defeated[`${x.id}Icon`], - description: `DAGGERHEART.CONFIG.Condition.${x.id}.description` - })); + return Object.keys(defeatedConditionChoices).reduce((acc, key) => { + const choice = defeatedConditionChoices[key]; + acc[key] = { + ...choice, + img: defeated[`${choice.id}Icon`], + description: `DAGGERHEART.CONFIG.Condition.${choice.id}.description` + }; + + return acc; + }, {}); }; const defeatedConditionChoices = { diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index 43623c94..c5fd19b9 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -85,7 +85,7 @@ export default class DamageField extends fields.SchemaField { const targetDamage = []; const damagePromises = []; for (let target of targets) { - const actor = fromUuidSync(target.actorId); + const actor = foundry.utils.fromUuidSync(target.actorId); if (!actor) continue; if (!config.hasHealing && config.onSave && target.saved?.success === true) { const mod = CONFIG.DH.ACTIONS.damageOnSave[config.onSave]?.mod ?? 1; @@ -98,17 +98,16 @@ export default class DamageField extends fields.SchemaField { }); } + const token = game.scenes.find(x => x.active).tokens.find(x => x.id === target.id); if (config.hasHealing) damagePromises.push( - actor - .takeHealing(config.damage) - .then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates })) + actor.takeHealing(config.damage).then(updates => targetDamage.push({ token, updates })) ); else damagePromises.push( actor .takeDamage(config.damage, config.isDirect) - .then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates })) + .then(updates => targetDamage.push({ token, updates })) ); } diff --git a/styles/less/hud/token-hud/token-hud.less b/styles/less/hud/token-hud/token-hud.less index 7d231e8c..c124d843 100644 --- a/styles/less/hud/token-hud/token-hud.less +++ b/styles/less/hud/token-hud/token-hud.less @@ -1,3 +1,9 @@ +.theme-light .daggerheart.placeable-hud { + .status-effects .effect-control { + filter: none; + } +} + .daggerheart.placeable-hud { .col.right { .palette {