fvtt-rolemaster-frp/module/sheets/items/rmss_transport_sheet.js

37 lines
1001 B
JavaScript
Raw Normal View History

2022-08-29 12:22:04 +02:00
// Our Item Sheet extends the default
export default class RMSSTransportSheet extends ItemSheet {
// Set the height and width
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
width: 530,
height: 440,
template: "systems/rmss/templates/sheets/items/rmss-transport-sheet.html",
classes: ["rmss", "sheet", "item"]
});
}
2022-08-29 12:22:04 +02:00
// If our sheet is called here it is.
get template() {
return "systems/rmss/templates/sheets/items/rmss-transport-sheet.html";
}
// Make the data available to the sheet template
async getData() {
const baseData = await super.getData();
2022-08-29 12:22:04 +02:00
let enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true});
2022-08-29 12:22:04 +02:00
let sheetData = {
owner: this.item.isOwner,
editable: this.isEditable,
item: baseData.item,
system: baseData.item.system,
config: CONFIG.rmss,
enrichedDescription: enrichedDescription
};
return sheetData;
}
}