Fix after testing
This commit is contained in:
@@ -76,6 +76,10 @@ export class HeritiersUtility {
|
||||
Handlebars.registerHelper('mul', function (a, b) {
|
||||
return parseInt(a) * parseInt(b);
|
||||
})
|
||||
Handlebars.registerHelper('and', function (...args) {
|
||||
// Last argument is Handlebars options object, ignore it
|
||||
return args.slice(0, -1).every(Boolean);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -197,10 +201,11 @@ export class HeritiersUtility {
|
||||
|
||||
const templatePaths = [
|
||||
'systems/fvtt-les-heritiers/templates/editor-notes-gm.html',
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-header.html',
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-description.html',
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-nav.html',
|
||||
'systems/fvtt-les-heritiers/templates/partial-utile-skills.html'
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-header.hbs',
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-description.hbs',
|
||||
'systems/fvtt-les-heritiers/templates/partial-item-nav.hbs',
|
||||
'systems/fvtt-les-heritiers/templates/partial-utile-skills.hbs',
|
||||
'systems/fvtt-les-heritiers/templates/partial-actor-equipment.hbs'
|
||||
]
|
||||
return foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||
}
|
||||
@@ -478,7 +483,7 @@ export class HeritiersUtility {
|
||||
this.computeArmeDegats(rollData, actor)
|
||||
}
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-cc-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-cc-result.hbs`, rollData)
|
||||
}, rollData, "selfroll")
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@@ -490,7 +495,7 @@ export class HeritiersUtility {
|
||||
this.computeMarge(rollData, valeurDefense)
|
||||
rollData.dureeAssommer = (rollData.marge) ? rollData.marge * 2 : 1
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-assommer-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-assommer-result.hbs`, rollData)
|
||||
}, rollData, "selfroll")
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@@ -570,6 +575,10 @@ export class HeritiersUtility {
|
||||
console.log(">>>> ", myRoll)
|
||||
this.computeResult(actor, rollData)
|
||||
this.computeMarge(rollData, rollData.sdValue) // Calcul de la marge si seuil présent
|
||||
// Compute weapon damage for successful attacks
|
||||
if (rollData.arme && rollData.isSuccess) {
|
||||
this.computeArmeDegats(rollData, actor)
|
||||
}
|
||||
}
|
||||
|
||||
if (rollData.mode == "init") {
|
||||
@@ -593,7 +602,7 @@ export class HeritiersUtility {
|
||||
}
|
||||
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.hbs`, rollData)
|
||||
}, rollData)
|
||||
|
||||
// Gestion attaque standard
|
||||
@@ -631,7 +640,7 @@ export class HeritiersUtility {
|
||||
this.computeResult(rollData)
|
||||
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.hbs`, rollData)
|
||||
}, rollData)
|
||||
|
||||
}
|
||||
@@ -844,7 +853,8 @@ export class HeritiersUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmDelete(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
// Support both jQuery and native elements
|
||||
let itemId = li.dataset ? li.dataset.itemId : li.data("item-id");
|
||||
let msgTxt = "<p>Certain de supprimer cet item ?";
|
||||
let buttons = {
|
||||
delete: {
|
||||
@@ -852,7 +862,11 @@ export class HeritiersUtility {
|
||||
label: "Oui !",
|
||||
callback: () => {
|
||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
if (li.slideUp) {
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
} else {
|
||||
actorSheet.render(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
|
||||
Reference in New Issue
Block a user