From 23dd021df609d53ec46e9d4c983d8d7d0740eb87 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 4 Feb 2024 21:13:40 -0700 Subject: [PATCH] Move context preparation common to all items into the GenericItemSheet --- module/sheets/Items/AspectSheet.mjs | 7 ------- module/sheets/Items/GenericItemSheet.mjs | 4 ++++ module/sheets/Items/PetSheet.mjs | 4 ---- module/sheets/Items/SpellSheet.mjs | 4 ---- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/module/sheets/Items/AspectSheet.mjs b/module/sheets/Items/AspectSheet.mjs index 976fa4d..5402e5e 100644 --- a/module/sheets/Items/AspectSheet.mjs +++ b/module/sheets/Items/AspectSheet.mjs @@ -23,13 +23,6 @@ export class AspectSheet extends GenericItemSheet { async getData() { const ctx = {}; - const item = this.item; - - ctx.item = item; - ctx.system = item.system; - ctx.flags = item.flags; - - console.log(item.uuid, `context:`, ctx); return ctx; }; }; \ No newline at end of file diff --git a/module/sheets/Items/GenericItemSheet.mjs b/module/sheets/Items/GenericItemSheet.mjs index 4023748..c756380 100644 --- a/module/sheets/Items/GenericItemSheet.mjs +++ b/module/sheets/Items/GenericItemSheet.mjs @@ -33,6 +33,10 @@ export class GenericItemSheet extends ItemSheet { idp: this.item.uuid, }; + ctx.item = this.item; + ctx.system = this.item.system; + ctx.flags = this.item.flags; + ctx.config = DOTDUNGEON; ctx.icons = CONFIG.CACHE.icons; diff --git a/module/sheets/Items/PetSheet.mjs b/module/sheets/Items/PetSheet.mjs index f3955af..169516c 100644 --- a/module/sheets/Items/PetSheet.mjs +++ b/module/sheets/Items/PetSheet.mjs @@ -23,10 +23,6 @@ export class PetSheet extends GenericItemSheet { async getData() { const ctx = await super.getData(); - - ctx.item = this.item; - ctx.system = this.item.system; - ctx.flags = this.item.flags; return ctx; }; }; diff --git a/module/sheets/Items/SpellSheet.mjs b/module/sheets/Items/SpellSheet.mjs index 281408a..cabf2db 100644 --- a/module/sheets/Items/SpellSheet.mjs +++ b/module/sheets/Items/SpellSheet.mjs @@ -23,10 +23,6 @@ export class SpellSheet extends GenericItemSheet { async getData() { const ctx = await super.getData(); - - ctx.item = this.item; - ctx.system = this.item.system; - ctx.flags = this.item.flags; return ctx; }; };