Add menus items to launch character archiver.
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,20 +1,46 @@
|
|||||||
import { initializeSettings } from "./settings.js";
|
import { initializeSettings } from "./settings.js";
|
||||||
|
import { CharacterArchiver } from "./apps/CharacterArchiver.js"
|
||||||
|
|
||||||
Hooks.on('init', async function () {
|
Hooks.on('init', async function () {
|
||||||
initializeSettings();
|
initializeSettings();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add to the character sheet header bar.
|
||||||
Hooks.on("getActorSheetHeaderButtons", (app, buttons) => {
|
Hooks.on("getActorSheetHeaderButtons", (app, buttons) => {
|
||||||
let theatreButtons = [];
|
let theatreButtons = [];
|
||||||
|
|
||||||
theatreButtons.push({
|
theatreButtons.push({
|
||||||
label: "Archive",
|
label: "Archive",
|
||||||
class: "send-to-archive",
|
class: "send-to-archive",
|
||||||
icon: "fas fa-mask",
|
icon: "fas fa-save",
|
||||||
onclick: (ev) => {
|
onclick: (ev) => {
|
||||||
|
|
||||||
|
new CharacterArchiver().render(true);
|
||||||
|
|
||||||
console.log("ARCHIVE ME!");
|
console.log("ARCHIVE ME!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttons.unshift(...theatreButtons);
|
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: '<i class="fas fa-save"></i>',
|
||||||
|
callback: (target) => {
|
||||||
|
|
||||||
|
new CharacterArchiver().render(true);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
2
templates/CharacterArchiver.hbs
Normal file
2
templates/CharacterArchiver.hbs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<form>
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user