From 52790fa45d273c9dce0c20bdd5274de71ab4e872 Mon Sep 17 00:00:00 2001 From: nsalyzyn Date: Thu, 18 Dec 2025 20:07:26 -0700 Subject: [PATCH] Adding max attributes and missing localization for them --- module/applications/sheets-configs/activeEffectConfig.mjs | 3 +++ module/data/actor/adversary.mjs | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/applications/sheets-configs/activeEffectConfig.mjs b/module/applications/sheets-configs/activeEffectConfig.mjs index 468aba5c..d7b1b536 100644 --- a/module/applications/sheets-configs/activeEffectConfig.mjs +++ b/module/applications/sheets-configs/activeEffectConfig.mjs @@ -9,6 +9,9 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac if (!ignoredActorKeys.includes(key)) { const model = game.system.api.models.actors[key]; const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model); + // As per DHToken._getTrackedAttributesFromSchema, attributes.bar have a max version as well. + const maxAttributes = attributes.bar.map(x => [...x, 'max']); + attributes.value.push(...maxAttributes); const group = game.i18n.localize(model.metadata.label); const choices = CONFIG.Token.documentClass .getTrackedAttributeChoices(attributes, model) diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index a7b66d4d..32f5c979 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -60,15 +60,13 @@ export default class DhpAdversary extends BaseDataActor { 0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', - true, - game.i18n.localize('DAGGERHEART.GENERAL.max') + true ), stress: resourceField( 0, 0, 'DAGGERHEART.GENERAL.stress', - true, - game.i18n.localize('DAGGERHEART.GENERAL.max') + true ) }), rules: new fields.SchemaField({