diff --git a/module/item-herbe-sheet.js b/module/item-herbe-sheet.js index 2ba7d546..616025a9 100644 --- a/module/item-herbe-sheet.js +++ b/module/item-herbe-sheet.js @@ -1,10 +1,11 @@ import { SYSTEM_RDD } from "./constants.js"; -import { EnvironmentSheetHelper as EnvironmentItemSheet } from "./environnement.js"; +import { EnvironmentSheetHelper } from "./environnement.js"; +import { RdDItemSheet } from "./item-sheet.js"; import { Misc } from "./misc.js"; const ITEM_TYPE = 'herbe'; -export class RdDHerbeItemSheet extends ItemSheet { +export class RdDHerbeItemSheet extends RdDItemSheet { static register() { Items.registerSheet(SYSTEM_RDD, RdDHerbeItemSheet, { @@ -15,31 +16,32 @@ export class RdDHerbeItemSheet extends ItemSheet { } static get defaultOptions() { - return EnvironmentItemSheet.defaultOptions(super.defaultOptions, ITEM_TYPE); + return EnvironmentSheetHelper.defaultOptions(super.defaultOptions, ITEM_TYPE); } _getHeaderButtons() { - return EnvironmentItemSheet.getHeaderButtons(this, super._getHeaderButtons()); + return EnvironmentSheetHelper.getHeaderButtons(this, super._getHeaderButtons()); } setPosition(options = {}) { - return EnvironmentItemSheet.setPosition(this, super.setPosition(options)); + return EnvironmentSheetHelper.setPosition(this, super.setPosition(options)); } async getData() { - return await EnvironmentItemSheet.getData(this); + const formData = await super.getData(); + return await EnvironmentSheetHelper.getData(this, formData); } activateListeners(html) { super.activateListeners(html); - EnvironmentItemSheet.activateListeners(this, html); + EnvironmentSheetHelper.activateListeners(this, html); } get template() { - return EnvironmentItemSheet.template(this.item.type); + return EnvironmentSheetHelper.template(this.item.type); } get title() { - return EnvironmentItemSheet.title(this.item); + return EnvironmentSheetHelper.title(this.item); } } diff --git a/module/item-ingredient-sheet.js b/module/item-ingredient-sheet.js index b5b0d322..6f5cd5f6 100644 --- a/module/item-ingredient-sheet.js +++ b/module/item-ingredient-sheet.js @@ -1,9 +1,10 @@ import { SYSTEM_RDD } from "./constants.js"; import { EnvironmentSheetHelper } from "./environnement.js"; +import { RdDItemSheet } from "./item-sheet.js"; import { Misc } from "./misc.js"; const ITEM_TYPE = 'ingredient'; -export class RdDIngredientItemSheet extends ItemSheet { +export class RdDIngredientItemSheet extends RdDItemSheet { static register() { Items.registerSheet(SYSTEM_RDD, RdDIngredientItemSheet, { @@ -26,7 +27,8 @@ export class RdDIngredientItemSheet extends ItemSheet { } async getData() { - return await EnvironmentSheetHelper.getData(this); + const formData = await super.getData(); + return await EnvironmentSheetHelper.getData(this, formData); } activateListeners(html) { diff --git a/module/item-sheet.js b/module/item-sheet.js index da1d316d..3ce65a19 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -73,9 +73,8 @@ export class RdDItemSheet extends ItemSheet { editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", isSoins: false, - description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), - descriptionmj: await TextEditor.enrichHTML(this.object.system.descriptionmj, {async: true}) - + description: await TextEditor.enrichHTML(this.item.system.description, {async: true}), + descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, {async: true}) } if (this.actor) { formData.isOwned = true;