Manage DR and damage roll
This commit is contained in:
@@ -152,6 +152,39 @@ Hooks.on(hookName, (message, html, data) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion du survol et du clic sur les boutons de dégâts pour les GMs
|
||||
if (game.user.isGM) {
|
||||
// Show damage buttons only for GM
|
||||
$(html).find(".li-apply-wounds").each((i, btn) => {
|
||||
btn.style.display = "block"
|
||||
})
|
||||
|
||||
$(html).find(".apply-wounds-btn").hover(
|
||||
function (event) {
|
||||
// Mouse enter - select the token and pan to it
|
||||
let combatantId = $(this).data("combatant-id")
|
||||
if (combatantId && game.combat) {
|
||||
let combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant?.token) {
|
||||
let token = canvas.tokens.get(combatant.token.id)
|
||||
if (token) {
|
||||
token.control({ releaseOthers: true })
|
||||
canvas.animatePan(token.center)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
function (event) {
|
||||
// Mouse leave - release selection
|
||||
canvas.tokens.releaseAll()
|
||||
}
|
||||
)
|
||||
|
||||
$(html).find(".apply-wounds-btn").click((event) => {
|
||||
LethalFantasyUtils.applyDamage(message, event)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
|
||||
Reference in New Issue
Block a user