Rip out the _preUpdate handling, it's complicated and messy to maintain
This commit is contained in:
parent
7970cb64c8
commit
5073c972e8
3 changed files with 63 additions and 66 deletions
|
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue