Support des maladresses

This commit is contained in:
2025-01-12 22:45:07 +01:00
parent 969bc3b573
commit 135e5e46a0
18 changed files with 98 additions and 92 deletions

View File

@ -12,10 +12,14 @@ const TEXT_ROLL_MANAGERS = [
new TextRollFormula()];
export class RdDTextEditor {
static registerChatCallbacks(html) {
html.on("click", '.roll-text', async event => await RdDTextEditor.rollText(event))
}
static async enrichHTML(text, object) {
static async enrichHTML(text, object, options = {}) {
const context = {
text, object,
options,
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
}
@ -59,14 +63,16 @@ export class RdDTextEditor {
const param = node.data('json')
const manager = TEXT_ROLL_MANAGERS.find(it => it.code == code)
const text = await TextRollManager.createRollText(manager.template,
param, false)
const text = await TextRollManager.createRollText(
{
code,
template: manager.template,
options: { showLink: false }
},
param)
ChatMessage.create({
content: text
})
}
}
static registerChatCallbacks(html) {
html.find('.roll-text').click(async event => await RdDTextEditor.rollText(event))
}
}