Other fixes for damage buttons from chat

This commit is contained in:
2026-05-20 10:53:22 +02:00
parent 6cf0880ad3
commit 9ccb0f90f0
33 changed files with 362 additions and 148 deletions
+3 -3
View File
@@ -369,7 +369,7 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
action: "applyDR",
label: game.i18n.localize("LETHALFANTASY.Combat.spellApplyDR"),
icon: "fa-solid fa-shield",
callback: (event, button, dialog) => Number(dialog.querySelector("[name='manualDr']")?.value) || 0
callback: (event, button) => Number(button.form?.elements?.manualDr?.value) || 0
},
{
action: "cancel",
@@ -393,7 +393,7 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
actorName: actor.name,
actorImage: actor.img
}
const roll = new LethalFantasyRoll(damageFormula, {}, rollOpts)
const roll = new documents.LethalFantasyRoll(damageFormula, {}, rollOpts)
await roll.evaluate()
roll.options.rollTotal = roll.total
if (game?.dice3d) await game.dice3d.showForRoll(roll, game.user, true)
@@ -408,7 +408,7 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
}
// Pour les monstres, utiliser prepareMonsterRoll
if (isMonster || actor.type === "monster") {
if (isMonster === "true" || actor.type === "monster") {
await actor.system.prepareMonsterRoll("monster-damage", weaponId, undefined, undefined, damageModifier)
return
}