commit c65e4dc9c0412107dd2ac384f1109e288afe085b Author: kyle Date: Wed Mar 5 19:45:02 2025 +0000 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..007ef48 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Kyle's Health Module for Foundry VTT diff --git a/module.js b/module.js new file mode 100644 index 0000000..855f45d --- /dev/null +++ b/module.js @@ -0,0 +1,38 @@ +function createHealthDisplay() { + // Create a new application to display the health overview + class HealthOverview extends Application { + constructor() { + super(); + } + + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + title: "Party Health Overview", + template: "modules/kyles-health-module/templates/health-overview.html", + width: 400, + height: "auto", + resizable: true + }); + } + + getData() { + const actors = game.actors.filter(a => a.hasPlayerOwner); + let data = actors.map(actor => { + let hp = actor.system.attributes.hp; + return { + name: actor.name, + current: hp.value, + max: hp.max, + }; + }); + return { + actors: data + }; + } + } + + new HealthOverview().render(true); +} + +// Run the function +createHealthDisplay(); diff --git a/module.json b/module.json new file mode 100644 index 0000000..7d5a152 --- /dev/null +++ b/module.json @@ -0,0 +1,23 @@ +{ + "name": "kyles-health-module", + "title": "Kyle's Health Module", + "description": "A module to display a party-wide health overview for ease of management by a healer or GM.", + "version": "1.0.0", + "author": "Kyle", + "minimumCoreVersion": "0.12.0", + "compatibleCoreVersion": "0.12.0", + "scripts": [], + "styles": [], + "esmodules": ["module.js"], + "languages": [], + "packs": [], + "system": [], + "crossOrigin": "anonymous", + "url": "https://your.website.or.github.io/health-overview", + "manifest": "https://your.website.or.github.io/health-overview/module.json", + "download": "https://your.website.or.github.io/health-overview/health-overview.zip", + "license": "LICENSE FILE OR URL", + "readme": "README FILE OR URL", + "bugs": "Where users can report issues, such as a GitHub issues page", + "dependencies": [] +} diff --git a/templates/health-overview.html b/templates/health-overview.html new file mode 100644 index 0000000..ac684db --- /dev/null +++ b/templates/health-overview.html @@ -0,0 +1,9 @@ +
+ {{#each actors}} +
+ {{this.name}} + + {{this.current}} / {{this.max}} +
+ {{/each}} +