Added a button to spend/restore uses of an action

This commit is contained in:
WBHarry 2025-08-06 17:37:14 +02:00
parent d186c62ee5
commit aef9828f86
7 changed files with 91 additions and 14 deletions

View file

@ -164,6 +164,12 @@ export function ActionMixin(Base) {
return foundry.utils.getProperty(this.parent, this.systemPath) instanceof Collection;
}
get remainingUses() {
if (!this.uses) return null;
return Math.max((this.uses.max ?? 0) - (this.uses.value ?? 0), 0);
}
static async create(data, operation = {}) {
const { parent, renderSheet } = operation;
let { type } = data;