Foundry v13 migration
All checks were successful
Release Creation / build (release) Successful in 58s
All checks were successful
Release Creation / build (release) Successful in 58s
This commit is contained in:
@ -22,28 +22,28 @@ export default class LethalFantasyUtils {
|
||||
static setHookListeners() {
|
||||
|
||||
Hooks.on('renderTokenHUD', async (hud, html, token) => {
|
||||
const lossHPButton = await renderTemplate('systems/fvtt-lethal-fantasy/templates/loss-hp-hud.hbs', {} )
|
||||
html.find('div.left').append(lossHPButton);
|
||||
html.find('img.lethal-hp-loss-hud').click((event) => {
|
||||
const lossHPButton = await foundry.applications.handlebars.renderTemplate('systems/fvtt-lethal-fantasy/templates/loss-hp-hud.hbs', {} )
|
||||
$(html).find('div.left').append(lossHPButton);
|
||||
$(html).find('img.lethal-hp-loss-hud').click((event) => {
|
||||
event.preventDefault();
|
||||
let hpMenu = html.find('.hp-loss-wrap')[0]
|
||||
let hpMenu = $(html).find('.hp-loss-wrap')[0]
|
||||
if (hpMenu.classList.contains("hp-loss-hud-disabled")) {
|
||||
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-disabled');
|
||||
} else {
|
||||
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
||||
}
|
||||
})
|
||||
html.find('.loss-hp-hud-click').click((event) => {
|
||||
$(html).find('.loss-hp-hud-click').click((event) => {
|
||||
event.preventDefault();
|
||||
let hpLoss = event.currentTarget.dataset.hpValue;
|
||||
if (token) {
|
||||
@ -51,12 +51,12 @@ export default class LethalFantasyUtils {
|
||||
console.log(tokenFull, token)
|
||||
let actor = tokenFull.actor;
|
||||
actor.applyDamage(Number(hpLoss));
|
||||
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
|
||||
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
|
||||
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
|
||||
$(html).find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user