2022-11-28 11:31:19 +01:00
|
|
|
import { SYSTEM_RDD } from "./constants.js";
|
|
|
|
import { EnvironmentSheetHelper } from "./environnement.js";
|
2022-12-03 01:21:30 +01:00
|
|
|
import { RdDItemSheet } from "./item-sheet.js";
|
2022-11-28 11:31:19 +01:00
|
|
|
import { Misc } from "./misc.js";
|
|
|
|
|
|
|
|
const ITEM_TYPE = 'ingredient';
|
2022-12-03 01:21:30 +01:00
|
|
|
export class RdDIngredientItemSheet extends RdDItemSheet {
|
2022-11-28 11:31:19 +01:00
|
|
|
|
|
|
|
static register() {
|
|
|
|
Items.registerSheet(SYSTEM_RDD, RdDIngredientItemSheet, {
|
|
|
|
label: Misc.typeName('Item', ITEM_TYPE),
|
|
|
|
types: [ITEM_TYPE],
|
|
|
|
makeDefault: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static get defaultOptions() {
|
|
|
|
return EnvironmentSheetHelper.defaultOptions(super.defaultOptions, ITEM_TYPE);
|
|
|
|
}
|
|
|
|
|
|
|
|
_getHeaderButtons() {
|
|
|
|
return EnvironmentSheetHelper.getHeaderButtons(this, super._getHeaderButtons());
|
|
|
|
}
|
|
|
|
|
|
|
|
setPosition(options = {}) {
|
|
|
|
return EnvironmentSheetHelper.setPosition(this, super.setPosition(options));
|
|
|
|
}
|
|
|
|
|
|
|
|
async getData() {
|
2022-12-03 01:21:30 +01:00
|
|
|
const formData = await super.getData();
|
|
|
|
return await EnvironmentSheetHelper.getData(this, formData);
|
2022-11-28 11:31:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
activateListeners(html) {
|
|
|
|
super.activateListeners(html);
|
|
|
|
EnvironmentSheetHelper.activateListeners(this, html);
|
|
|
|
}
|
|
|
|
|
|
|
|
get template() {
|
|
|
|
return EnvironmentSheetHelper.template(this.item.type);
|
|
|
|
}
|
|
|
|
|
|
|
|
get title() {
|
|
|
|
return EnvironmentSheetHelper.title(this.item);
|
|
|
|
}
|
|
|
|
}
|