Move resources select to scrolly text and accept actor object

This commit is contained in:
Carlos Fernandez 2026-03-09 21:56:25 -04:00
parent a4a7b8e7ca
commit 007d1bc055
4 changed files with 18 additions and 17 deletions

View file

@ -213,7 +213,7 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
const textData = Object.keys(changes.system.resources).reduce((acc, key) => {
const resource = changes.system.resources[key];
if (resource.value !== undefined && resource.value !== this.resources[key].value) {
acc.push(getScrollTextData(this.resources, resource, key, this.parent.type));
acc.push(getScrollTextData(this.parent, resource, key));
}
return acc;

View file

@ -225,10 +225,9 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
changed.system?.marks?.value !== undefined && changed.system.marks.value !== this.marks.value;
if (armorChanged && autoSettings.resourceScrollTexts && this.parent.parent?.type === 'character') {
const armorData = getScrollTextData(
this.parent.parent.system.resources,
this.parent.parent,
changed.system.marks,
'armor',
this.parent.parent.type
);
options.scrollingTextData = [armorData];
}