Files
l5rx-chiaroscuro/system/scripts/items/item-sheet.js
2020-12-18 13:55:28 +01:00

49 lines
1.4 KiB
JavaScript

/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class ItemSheetL5r5e extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "item"],
template: CONFIG.l5r5e.paths.templates + "item/item-sheet.html",
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.ringsList = game.l5r5e.HelpersL5r5e.getRingsList();
sheetData.data.techniquesList = game.l5r5e.HelpersL5r5e.getTechniquesList();
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
// if (!this.options.editable) {
// return;
// }
}
/**
* Update the item with data from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}