Initial import
This commit is contained in:
61
module/item/item-sheet.js
Normal file
61
module/item/item-sheet.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class frostgraveItemSheet extends ItemSheet {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["frostgrave", "sheet", "item"],
|
||||
width: 450,
|
||||
height: 500,
|
||||
tabs: [{
|
||||
navSelector: ".sheet-tabs",
|
||||
contentSelector: ".sheet-body",
|
||||
initial: "attributes",
|
||||
}, ],
|
||||
});
|
||||
}
|
||||
|
||||
/** @override */
|
||||
get template() {
|
||||
const path = "systems/frostgrave/templates/item";
|
||||
// Return a single sheet for all item types.
|
||||
// return `${path}/item-sheet.html`;
|
||||
|
||||
// Alternatively, you could use the following return statement to do a
|
||||
// unique item sheet by type, like `weapon-sheet.html`.
|
||||
return `${path}/item-${this.item.data.type}-sheet.html`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
return 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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user