Rip out the _preUpdate handling, it's complicated and messy to maintain

This commit is contained in:
Oliver 2026-04-23 17:04:17 -06:00
parent 7970cb64c8
commit 5073c972e8
3 changed files with 63 additions and 66 deletions

View file

@ -83,22 +83,12 @@ export class TAFTokenDocument extends TokenDocument {
if (`value` in data && `max` in data) {
let editable = hasProperty(system, `${attribute}.value`);
const isRange = getProperty(system, `${attribute}.isRange`);
if (isRange) {
return {
type: `bar`,
attribute,
value: parseInt(data.value || 0),
max: parseInt(data.max || 0),
editable,
};
} else {
return {
type: `value`,
attribute: `${attribute}.value`,
value: Number(data.value),
editable,
};
return {
type: `bar`,
attribute,
value: parseInt(data.value || 0),
max: parseInt(data.max || 0),
editable,
};
};