Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Bump version, update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam committed Dec 14, 2022
1 parent 5225b42 commit 9bd6339
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
22 changes: 12 additions & 10 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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() {
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
});
}
}

Expand Down

0 comments on commit 9bd6339

Please sign in to comment.