Made it work. But I hate it.

This commit is contained in:
WBHarry 2026-02-04 22:38:49 +01:00
parent 044d184832
commit d2fc9fd648
2 changed files with 67 additions and 11 deletions

View file

@ -8,13 +8,10 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
this.changeChoices = Object.keys(game.system.api.models.actors).reduce((acc, key) => {
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 attributes = CONFIG.Token.documentClass.getTrackedAttributes(model, [], true);
const group = game.i18n.localize(model.metadata.label);
const choices = CONFIG.Token.documentClass
.getTrackedAttributeChoices(attributes, model)
.getTrackedAttributeChoices(attributes, model, true)
.map(x => ({ ...x, group: group }));
acc.push(...choices);
}