Liens jets de dés dans les journaux
This commit is contained in:
28
module/journal/journal-sheet.js
Normal file
28
module/journal/journal-sheet.js
Normal file
@ -0,0 +1,28 @@
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll.js";
|
||||
import { SYSTEM_RDD } from "../constants.js";
|
||||
import { Misc } from "../misc.js";
|
||||
|
||||
|
||||
export class RdDJournalSheet extends JournalTextPageSheet {
|
||||
static register() {
|
||||
DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", JournalTextPageSheet)
|
||||
DocumentSheetConfig.registerSheet(JournalEntryPage,
|
||||
SYSTEM_RDD,
|
||||
RdDJournalSheet, {
|
||||
types: ["text"],
|
||||
makeDefault: true,
|
||||
});
|
||||
}
|
||||
|
||||
async getData(options) {
|
||||
const journalData = await super.getData(options);
|
||||
journalData.editor.content = await RdDTextEditor.enrichHTML(journalData.document.text.content, this.object)
|
||||
return journalData
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
html.find('.roll-carac-competence').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user