diff --git a/scripts/apps/CharacterArchiver.js b/scripts/apps/CharacterArchiver.js index e69de29..b6b9a14 100644 --- a/scripts/apps/CharacterArchiver.js +++ b/scripts/apps/CharacterArchiver.js @@ -0,0 +1,14 @@ + +export class CharacterArchiver extends FormApplication { + + static get defaultOptions() { + const options = super.defaultOptions; + options.id = "character-archiver"; + options.template = "modules/rush-character-archive-foundry-module/templates/CharacterArchiver.hbs"; + options.width = 500; + options.height = 270; + options.tabs = [{ navSelector: ".tabs", contentSelector: ".theatre-config-contents", initial: "main" }]; + return options; + } + +} \ No newline at end of file diff --git a/scripts/index.js b/scripts/index.js index bf6d535..0db91fc 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -1,20 +1,46 @@ import { initializeSettings } from "./settings.js"; +import { CharacterArchiver } from "./apps/CharacterArchiver.js" Hooks.on('init', async function () { initializeSettings(); }); +// Add to the character sheet header bar. Hooks.on("getActorSheetHeaderButtons", (app, buttons) => { let theatreButtons = []; theatreButtons.push({ label: "Archive", class: "send-to-archive", - icon: "fas fa-mask", + icon: "fas fa-save", onclick: (ev) => { + + new CharacterArchiver().render(true); + console.log("ARCHIVE ME!"); } }); buttons.unshift(...theatreButtons); +}); + +// Add to the character context menu. +Hooks.on("getActorDirectoryEntryContext", async (html, options) => { + + const getActorData = (target) => { + return game.actors.get(target.data("documentId")); + }; + + options.splice( + 3, + 0, + { + name: "Archive", + icon: '', + callback: (target) => { + + new CharacterArchiver().render(true); + }, + }, + ); }); \ No newline at end of file diff --git a/templates/CharacterArchiver.hbs b/templates/CharacterArchiver.hbs new file mode 100644 index 0000000..2248026 --- /dev/null +++ b/templates/CharacterArchiver.hbs @@ -0,0 +1,2 @@ +
+
\ No newline at end of file