Files
foundry-Slamother/module/item/item-sheet.js
T
Martin Jencka bcb2b0079a Foundry 0.8 Upgrade - 0.8.6
Foundry 0.8.6 upgrade. Hopefully things work out well, I recommend backing up your old worlds before moving to this version.

Also includes a couple of new features and bugfixes.
2021-06-07 21:29:32 -06:00

59 lines
1.6 KiB
JavaScript

/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MothershipItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["mosh", "sheet", "item"],
width: 520,
height: 480,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
});
}
/** @override */
get template() {
const path = "systems/mosh/templates/item";
// Return a single sheet for all item types.
return `${path}/item-${this.item.data.type}-sheet.html`;
// Alternatively, you could use the following return statement to do a
// unique item sheet by type, like `weapon-sheet.html`.
// return `${path}/${this.item.data.type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
getData() {
const data = super.getData();
return data.data;
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Roll handlers, click handlers, etc. would go here.
}
}