mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-07-04 13:47:10 -04:00
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:
parent
9bb368d9e2
commit
50041d510c
7 changed files with 77 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue