feat: init export html button

This commit is contained in:
Matthieu CAILLEAUX
2022-04-23 21:05:13 +02:00
parent a246f899f4
commit 986d50a5eb
5 changed files with 25 additions and 2 deletions

View File

@@ -30,6 +30,17 @@ Hooks.on('getActorDirectoryEntryContext', async (_, options) => {
);
await generatePdf(actor);
},
},
{
name: i18nLocalize('WFRP4SHEETPRINT.export.html'),
condition: isGM(),
icon: '<i class="fas fa-file-code"></i>',
callback: async (target) => {
const actor: Actor & any = (<any>game).actors.get(
target.attr('data-document-id')
);
await generateHtml(actor);
},
});
});
@@ -60,6 +71,10 @@ function addActorSheetActionButton(
title.after(button);
}
async function generateHtml(actor: Actor & any) {
console.dir(actor);
}
async function generatePdf(actor: Actor & any) {
const actorData = actor.data;
// @ts-ignore