foundryvtt-beam-saber/module/blades-item-sheet.js
drewg13 ea0e308891
Updates for 0.8.x (#118)
* Merge tag '2.17' into development (#117)

* Updates for 0.8.x

Updates for 0.8.x

Co-authored-by: megastruktur <astromortis@gmail.com>
2021-05-25 13:27:40 +03:00

56 lines
1.4 KiB
JavaScript

/**
* Extend the basic ItemSheet
* @extends {ItemSheet}
*/
export class BladesItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["blades-in-the-dark", "sheet", "item"],
width: 560,
height: 'auto',
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
/** @override */
get template() {
const path = "systems/blades-in-the-dark/templates/items";
let simple_item_types = ["background", "heritage", "vice", "crew_reputation"];
let template_name = `${this.item.data.type}`;
if (simple_item_types.indexOf(this.item.data.type) >= 0) {
template_name = "simple";
}
return `${path}/${template_name}.html`;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/* -------------------------------------------- */
/** @override */
getData() {
const data = super.getData();
data.isGm = game.user.isGM;
data.editable = this.options.editable;
const itemData = data.data;
data.actor = itemData;
data.data = itemData.data;
return data;
}
}