feat: Add module description and README, update default overlay border color, and use foundry.utils.hasProperty.

This commit is contained in:
CPTN Cosmo 2025-12-30 23:04:55 +01:00
parent fcf12c64c6
commit 587a9a15da
3 changed files with 16 additions and 2 deletions

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# Daggerheart Environment Overlay
A FoundryVTT module for the **Daggerheart** system that allows GMs to link **Environment** type actors to specific scenes. When a linked scene is active, the environment actor's token is displayed as an interactive, persistent overlay on the canvas.
## Features
- **Scene Linking**: Drag and drop an Environment actor into the Scene Configuration to link it.
- **Interactive Overlay**: Click the overlay to instantly open the Environment actor's sheet.
- **Movable Interface**: Hold `Alt` + Left Click and Drag to reposition the overlay. The position is saved per-scene.
- **Customizable**:
- Toggle the display of the actor's name.
- Customize the border color of the overlay token.
- **Permission Support**: The overlay respects ownership permissions, ensuring only relevant users can see or interact with it.

View file

@ -1,6 +1,7 @@
{ {
"id": "dh-environment-overlay", "id": "dh-environment-overlay",
"title": "Daggerheart Environment Overlay", "title": "Daggerheart Environment Overlay",
"description": "Links Environment actors to scenes, displaying them as interactive, movable overlays on the canvas.",
"version": "1.0.0", "version": "1.0.0",
"compatibility": { "compatibility": {
"minimum": "13", "minimum": "13",

View file

@ -10,7 +10,7 @@ Hooks.once("init", () => {
scope: "world", scope: "world",
config: true, config: true,
type: String, type: String,
default: "#ffcc00", default: "#f3c267",
onChange: () => renderEnvironmentOverlay() onChange: () => renderEnvironmentOverlay()
}); });
@ -271,7 +271,7 @@ Hooks.on("updateScene", (document, change, options, userId) => {
if (!document.isView) return; if (!document.isView) return;
if (canvas.scene && document.id === canvas.scene.id) { if (canvas.scene && document.id === canvas.scene.id) {
if (hasProperty(change, `flags.${MODULE_ID}`)) { if (foundry.utils.hasProperty(change, `flags.${MODULE_ID}`)) {
const flags = change.flags[MODULE_ID]; const flags = change.flags[MODULE_ID];
if (flags) { if (flags) {
if (flags[FLAG_KEY] !== undefined) { if (flags[FLAG_KEY] !== undefined) {