From 902cc4f2e8e8565b5837c8c67eb77a86a01804c9 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Sun, 3 Aug 2025 21:19:54 -0700 Subject: [PATCH] fixing stuff --- package.json | 1 + src/ts/module.ts | 9 ++++++--- src/ts/settings.ts | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 434fa35..38d81f1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "build": "tsc && vite build" }, + "type": "module", "devDependencies": { "rollup-plugin-copy": "^3.5.0", "typescript": "^5.8.3", diff --git a/src/ts/module.ts b/src/ts/module.ts index ada4d68..330f26d 100644 --- a/src/ts/module.ts +++ b/src/ts/module.ts @@ -76,11 +76,13 @@ Hooks.on("getActorSheetHeaderButtons", (app: any, buttons: any) => { // 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")); + return (game as Game).actors!.get(target.data("documentId")); }; console.log(getActorData) @@ -91,10 +93,11 @@ Hooks.on("getActorDirectoryEntryContext", async (html: any, options: any) => { { name: "Archive", icon: '', - callback: (target) => { - + callback: (target: any) => { + console.log(target) new CharacterArchiver().render(true); }, }, ); + }); \ No newline at end of file diff --git a/src/ts/settings.ts b/src/ts/settings.ts index aa09e1d..b1a4876 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -1,22 +1,22 @@ import {MODULE_ID, URI_SETTING_NAME, API_KEY_NAME} from "./common.js" export function initializeSettings() { - game.settings.register(MODULE_ID, URI_SETTING_NAME, { + (game as Game).settings!.register(MODULE_ID, URI_SETTING_NAME, { name: "Archive Server URI", hint: "Address of the character archive server.", scope: "world", config: true, - restricted: true, + // restricted: true, default: "https://chararchive.cyberpunkrush.com", type: String, }); - game.settings.register(MODULE_ID, API_KEY_NAME, { + (game as Game).settings!.register(MODULE_ID, API_KEY_NAME, { name: "API Key", hint: "API key to use when communicating with the archive server.", scope: "world", config: true, - restricted: true, + // restricted: true, default: "", type: String, });