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