Add an ItemHandler class and prevent players from having more than 1 aspect.
This commit is contained in:
parent
82108bfe5f
commit
38fcb1193a
7 changed files with 49 additions and 6 deletions
|
|
@ -1,4 +1,6 @@
|
|||
export class AspectSheet extends ItemSheet {
|
||||
import { GenericItemSheet } from "./GenericItemSheet.mjs";
|
||||
|
||||
export class AspectSheet extends GenericItemSheet {
|
||||
static get defaultOptions() {
|
||||
let opts = mergeObject(
|
||||
super.defaultOptions,
|
||||
|
|
@ -21,13 +23,13 @@ export class AspectSheet extends ItemSheet {
|
|||
|
||||
async getData() {
|
||||
const ctx = {};
|
||||
const item = this.item.toObject(false);
|
||||
const item = this.item;
|
||||
|
||||
ctx.name = super.name;
|
||||
ctx.item = item;
|
||||
ctx.system = item.system;
|
||||
ctx.flags = item.flags;
|
||||
|
||||
console.log(item.uuid, `context:`, ctx);
|
||||
return ctx;
|
||||
};
|
||||
};
|
||||
|
|
@ -33,7 +33,7 @@ export class PlayerSheet extends GenericActorSheet {
|
|||
canAddAspect: ctx.items.aspect.length == 0,
|
||||
};
|
||||
|
||||
console.log(ctx)
|
||||
console.log(actor.uuid, `context:`, ctx)
|
||||
return ctx;
|
||||
};
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ export class SpellSheet extends GenericItemSheet {
|
|||
super.activateListeners(html);
|
||||
|
||||
if (!this.isEditable) return;
|
||||
console.debug(`.dungeon | Adding event listeners for Generic Item: ${this.id}`);
|
||||
console.debug(`.dungeon | Adding event listeners for Spell Item: ${this.id}`);
|
||||
};
|
||||
|
||||
async getData() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue