This commit is contained in:
iamBadgers
2025-08-03 20:59:52 -07:00
parent b3548db874
commit 31b90f3338
12 changed files with 111 additions and 15 deletions

View File

@@ -6,6 +6,9 @@ import { ModuleData } from "@league-of-foundry-developers/foundry-vtt-types/src/
import { id as moduleId } from "../module.json";
import DogBrowser from "./apps/NewCharacter";
import { initializeSettings } from "./settings";
import { CharacterArchiver } from "./apps/CharacterArchiver"
interface MyModule extends Game.ModuleData<ModuleData> {
dogBrowser: DogBrowser;
@@ -14,6 +17,10 @@ interface MyModule extends Game.ModuleData<ModuleData> {
let module: MyModule;
Hooks.once("init", async () => {
initializeSettings();
console.log("hello world!");
@@ -43,3 +50,51 @@ Hooks.once("init", async () => {
module.dogBrowser = new DogBrowser();
module.dogBrowser.render(true);
});
// Add to the character sheet header bar.
Hooks.on("getActorSheetHeaderButtons", (app: any, buttons: any) => {
console.log(app);
let theatreButtons = [];
theatreButtons.push({
label: "Archive",
class: "send-to-archive",
icon: "fas fa-save",
onclick: (ev: any) => {
console.log(ev)
new CharacterArchiver().render(true);
console.log("ARCHIVE ME!");
}
});
buttons.unshift(...theatreButtons);
});
// Add to the character context menu.
Hooks.on("getActorDirectoryEntryContext", async (html: any, options: any) => {
console.log(html)
const getActorData = (target: any) => {
console.log(target)
return game.actors.get(target.data("documentId"));
};
console.log(getActorData)
options.splice(
3,
0,
{
name: "Archive",
icon: '<i class="fas fa-save"></i>',
callback: (target) => {
new CharacterArchiver().render(true);
},
},
);
});