Add the capacity display (closes #96)
This commit is contained in:
parent
b6ca477be7
commit
aab71df1fc
3 changed files with 16 additions and 4 deletions
|
|
@ -58,6 +58,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
canAddAspect: !await actor.proxyFunction.bind(actor)(`atAspectLimit`),
|
||||
stats: this.#statData,
|
||||
itemFilters: this.#itemFilters,
|
||||
capacity: this.#inventoryCapacity,
|
||||
};
|
||||
console.log(ctx)
|
||||
return ctx;
|
||||
|
|
@ -134,6 +135,14 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
return filters;
|
||||
};
|
||||
|
||||
get #inventoryCapacity() {
|
||||
return {
|
||||
used: this.actor.items
|
||||
.reduce((sum, i) => sum + i.system.uses_inventory_slot ? i.system.quantity : 0, 0),
|
||||
max: this.actor.system.inventory_slots,
|
||||
};
|
||||
};
|
||||
|
||||
_updateObject(...args) {
|
||||
console.log(args)
|
||||
super._updateObject(...args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue