Finalize aappv2 data models migration
This commit is contained in:
@@ -56,7 +56,7 @@ export class MaleficesUtility {
|
||||
name: "character-summary-data",
|
||||
scope: "world",
|
||||
config: false,
|
||||
default: { npcList: [], x: 200, y: 200 },
|
||||
default: { extraList: [], x: 200, y: 200 },
|
||||
type: Object
|
||||
})
|
||||
|
||||
@@ -135,8 +135,13 @@ export class MaleficesUtility {
|
||||
|
||||
const templatePaths = [
|
||||
'systems/fvtt-malefices/templates/actors/editor-notes-gm.hbs',
|
||||
'systems/fvtt-malefices/templates/items/partial-item-header.hbs',
|
||||
'systems/fvtt-malefices/templates/items/partial-item-nav.hbs',
|
||||
'systems/fvtt-malefices/templates/items/partial-item-description.hbs'
|
||||
'systems/fvtt-malefices/templates/items/partial-item-description.hbs',
|
||||
'systems/fvtt-malefices/templates/post-item.hbs',
|
||||
'systems/fvtt-malefices/templates/actors/npc-sheet.hbs',
|
||||
'systems/fvtt-malefices/templates/chat/welcome-message.hbs',
|
||||
'systems/fvtt-malefices/templates/dialogs/character-summary.hbs'
|
||||
]
|
||||
return foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||
}
|
||||
@@ -385,7 +390,7 @@ export class MaleficesUtility {
|
||||
rollData.total = selectedCard.value
|
||||
rollData.selectedCard = selectedCard
|
||||
await MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
})
|
||||
|
||||
this.computeResults(rollData)
|
||||
@@ -399,7 +404,7 @@ export class MaleficesUtility {
|
||||
}
|
||||
|
||||
await MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/chat-confrontation-result.hbs`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-malefices/templates/chat/chat-confrontation-result.hbs`, rollData)
|
||||
})
|
||||
this.processSpecialCard(actor, rollData)
|
||||
}
|
||||
@@ -554,30 +559,16 @@ export class MaleficesUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmDelete(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
let msgTxt = "<p>Are you sure to remove this Item ?";
|
||||
let buttons = {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Yes, remove it",
|
||||
callback: () => {
|
||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Cancel"
|
||||
}
|
||||
}
|
||||
msgTxt += "</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirm removal",
|
||||
content: msgTxt,
|
||||
buttons: buttons,
|
||||
default: "cancel"
|
||||
const itemId = li.dataset.itemId;
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: { title: "Confirmer la suppression" },
|
||||
content: "<p>Supprimer cet objet ?</p>",
|
||||
yes: { label: "Supprimer", icon: "fas fa-trash" },
|
||||
no: { label: "Annuler", icon: "fas fa-times" },
|
||||
});
|
||||
d.render(true);
|
||||
if (confirmed) {
|
||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user