From 2d59048a5e12f95475b960bd347660aeba695f19 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Sat, 12 Jul 2025 17:27:05 -0700 Subject: [PATCH] testing out get calls --- scripts/common.js | 3 ++- scripts/index.js | 10 ++++++++++ scripts/settings.js | 13 ++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/common.js b/scripts/common.js index 9204109..266d1e0 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -1,4 +1,5 @@ export const MODULE_ID = "rush-character-archive-foundry-module"; -export const URI_SETTING_NAME = "uri_setting"; \ No newline at end of file +export const URI_SETTING_NAME = "uri_setting"; +export const API_KEY_NAME = "api_key"; \ No newline at end of file diff --git a/scripts/index.js b/scripts/index.js index 0db91fc..2dfa33c 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -3,6 +3,16 @@ import { CharacterArchiver } from "./apps/CharacterArchiver.js" Hooks.on('init', async function () { initializeSettings(); + + console.log("HERE"); + let xmlHttp = new XMLHttpRequest(); + console.log("HERE 1"); + xmlHttp.open("GET", "http://localhost:8080", false); + console.log("HERE 2"); + xmlHttp.send(null); + console.log("HERE 3"); + console.log(xmlHttp.responseText); + console.log("HERE 4"); }); // Add to the character sheet header bar. diff --git a/scripts/settings.js b/scripts/settings.js index 1ae7f56..aa09e1d 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -1,4 +1,4 @@ -import {MODULE_ID, URI_SETTING_NAME} from "./common.js" +import {MODULE_ID, URI_SETTING_NAME, API_KEY_NAME} from "./common.js" export function initializeSettings() { game.settings.register(MODULE_ID, URI_SETTING_NAME, { @@ -6,7 +6,18 @@ export function initializeSettings() { hint: "Address of the character archive server.", scope: "world", config: true, + restricted: true, default: "https://chararchive.cyberpunkrush.com", type: String, }); + + 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, + default: "", + type: String, + }); }