Files
l5rx-chiaroscuro/system/scripts/journal.js
Vlyan e7bd9ea3fb Working on Compatibility for FVTT v10
SendToChat : Fix Journal behaviour
2022-07-23 21:59:13 +02:00

27 lines
754 B
JavaScript

/**
* Extends the JournalEntity to process special things from L5R.
*/
export class JournalL5r5e extends JournalEntry {
/**
* Render the text template for this Journal (tooltips and chat)
* @return {Promise<string|null>}
*/
async renderTextTemplate() {
const data = (await this.sheet?.getData()) || this;
const pageData = data.pages[0];
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}journal/journal-text.html`, {
data: pageData,
});
return tpl || null;
}
/**
* Return the Current JournalEntryPage
* @return JournalEntryPage
*/
getCurrentPage() {
return Array.from(this.pages)[this.sheet?.pageIndex || 0] || null;
}
}