mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
Added confirm dialogs to delete
This commit is contained in:
parent
5aa9ba661a
commit
b3c9ee87b0
7 changed files with 100 additions and 9 deletions
|
|
@ -249,7 +249,23 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
{
|
||||
name: 'DAGGERHEART.Sheets.PC.ContextMenu.Delete',
|
||||
icon: '<i class="fa-solid fa-trash"></i>',
|
||||
callback: el => getItem(el).delete()
|
||||
callback: async el => {
|
||||
const item = getItem(el);
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: {
|
||||
title: game.i18n.format('DAGGERHEART.APPLICATIONS.DeleteConfirmation.title', {
|
||||
type: game.i18n.localize(`TYPES.${item.documentName}.${item.type}`),
|
||||
name: item.name
|
||||
})
|
||||
},
|
||||
content: game.i18n.format('DAGGERHEART.APPLICATIONS.DeleteConfirmation.text', {
|
||||
name: item.name
|
||||
})
|
||||
});
|
||||
if (!confirmed) return;
|
||||
|
||||
item.delete();
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -372,7 +388,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
li.hidden = !(menu.has(item.id) && matchesSearch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Filter Menus */
|
||||
/* -------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue