12: Add resource attribute type

- Added a resource attribute type to both actors and items with the keys
  min, value, and max.
- Added translation strings for the sublabels on resources.
This commit is contained in:
Matt Smith 2020-08-22 12:49:52 -05:00
parent 9bb368d9e2
commit 50041d510c
7 changed files with 77 additions and 5 deletions

View file

@ -21,9 +21,10 @@ export class SimpleActorSheet extends ActorSheet {
/** @override */
getData() {
const data = super.getData();
data.dtypes = ["String", "Number", "Boolean", "Formula"];
data.dtypes = ["String", "Number", "Boolean", "Formula", "Resource"];
for ( let attr of Object.values(data.data.attributes) ) {
attr.isCheckbox = attr.dtype === "Boolean";
attr.isResource = attr.dtype === "Resource";
}
data.shorthand = !!game.settings.get("worldbuilding", "macroShorthand");
return data;

View file

@ -20,9 +20,10 @@ export class SimpleItemSheet extends ItemSheet {
/** @override */
getData() {
const data = super.getData();
data.dtypes = ["String", "Number", "Boolean", "Formula"];
data.dtypes = ["String", "Number", "Boolean", "Formula", "Resource"];
for ( let attr of Object.values(data.data.attributes) ) {
attr.isCheckbox = attr.dtype === "Boolean";
attr.isResource = attr.dtype === "Resource";
}
return data;
}