From 9bd633903de9bd1714205bf4b05f0c49c63c4ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Sim=C3=B5es?= Date: Wed, 14 Dec 2022 13:55:25 -0600 Subject: [PATCH] Bump version, update changelog --- CHANGELOG.md | 5 +++++ module.json | 4 ++-- script.js | 22 ++++++++++++---------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c2145..83d70ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Version 0.2.0 +* Restrict Blindsight by total cover (movement restriction) instead of line of sight +* Rename Feel Tremor and See All modes to Tremorsense and Truesight +* Disable `TokenConfig` input fields that are managed by "Link Actor Senses" feature + ## Version 0.1.0 * Add echolocation as a detection mode * Add devil's sight as a separate detection mode to visually distinguish it from See Invisibility diff --git a/module.json b/module.json index e7fbf65..42f3b6b 100644 --- a/module.json +++ b/module.json @@ -11,10 +11,10 @@ "scripts": [ "script.js" ], - "version": "0.1.0", + "version": "0.2.0", "compatibility": { "minimum": "10", - "verified": "10.288" + "verified": "10.291" }, "relationships": { "systems": [ diff --git a/script.js b/script.js index 76cbdc5..bc29abe 100644 --- a/script.js +++ b/script.js @@ -107,13 +107,16 @@ Hooks.on("updateToken", (token, changes, context, userId) => { Hooks.on("renderTokenConfig", (sheet, html) => { if (!game.settings.get("adequate-vision", "linkActorSenses")) return; // Disable input fields that are automatically managed - html[0].querySelectorAll(` + html[0] + .querySelectorAll( + ` [name="sight.range"], [name="sight.visionMode"], [name="sight.brightness"], [name="sight.saturation"], [name="sight.contrast"], - [name^="detectionModes."]`) + [name^="detectionModes."]` + ) .forEach((e) => { e.disabled = true; @@ -128,8 +131,7 @@ Hooks.on("renderTokenConfig", (sheet, html) => { } }); // Remove the buttons to add/remove detection modes - html[0].querySelectorAll(`.detection-mode-controls`) - .forEach((e) => e.remove()); + html[0].querySelectorAll(`.detection-mode-controls`).forEach((e) => e.remove()); }); function onReady() { @@ -193,7 +195,7 @@ function updateTokens(actor, { force = false } = {}) { // Don't override vision tint and attenuation set by the user delete updates.sight.attenuation; - delete updates.sight.color + delete updates.sight.color; // DETECTION MODES @@ -287,11 +289,11 @@ class BlindDetectionMode extends DetectionMode { /** @override */ _testLOS(visionSource, mode, target, test) { // Blindsight is restricted by total cover - return !CONFIG.Canvas.losBackend.testCollision( - { x: visionSource.x, y: visionSource.y }, - test.point, - { type: "move", mode: "any", source: visionSource } - ); + return !CONFIG.Canvas.losBackend.testCollision({ x: visionSource.x, y: visionSource.y }, test.point, { + type: "move", + mode: "any", + source: visionSource, + }); } }