foundryvtt-beam-saber/module/item-sheet.js
Peter Varaksin 11ee6f6434 Development
- Adds Crew Features item type
- Adds Reputation-turf Crew styling and logic
2020-04-27 16:58:52 +03:00

60 lines
1.4 KiB
JavaScript

/**
* Extend the basic ItemSheet
* @extends {ItemSheet}
*/
export class BladesItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["blades-in-the-dark", "sheet", "item"],
width: 900,
height: 900,
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_feature"];
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 */
getData() {
const data = super.getData();
return data;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/* -------------------------------------------- */
/** override */
_getFormData(form) {
const FD = BladesHelpers.getFormDataHelper(form, this.editors);
return FD;
}
/* -------------------------------------------- */
}