diff --git a/module.json b/module.json index 9581e8d..cacc31f 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ "email": "dev7355608@gmail.com" } ], - "version": "1.1.2", + "version": "1.1.3", "compatibility": { "minimum": "10", "verified": "12" @@ -18,8 +18,8 @@ ], "url": "https://github.com/dev7355608/gm-vision", "manifest": "https://github.com/dev7355608/gm-vision/releases/latest/download/module.json", - "download": "https://github.com/dev7355608/gm-vision/releases/download/v1.1.2/module.zip", - "changelog": "https://github.com/dev7355608/gm-vision/releases/tag/v1.1.2", + "download": "https://github.com/dev7355608/gm-vision/releases/download/v1.1.3/module.zip", + "changelog": "https://github.com/dev7355608/gm-vision/releases/tag/v1.1.3", "bugs": "https://github.com/dev7355608/gm-vision/issues", "readme": "https://raw.githubusercontent.com/dev7355608/gm-vision/main/README.md", "license": "https://raw.githubusercontent.com/dev7355608/gm-vision/main/LICENSE" diff --git a/script.js b/script.js index 8a6dc7e..58741c7 100644 --- a/script.js +++ b/script.js @@ -14,7 +14,7 @@ Hooks.once("init", () => { active = value; - if (foundry.utils.isNewerVersion(game.version, 12)) { + if (game.release.generation >= 12) { canvas.perception.update({ refreshVision: true }); } else { canvas.perception.update({ refreshVision: true }, true); @@ -90,9 +90,6 @@ Hooks.once("init", () => { CONFIG.Token.objectClass = class extends CONFIG.Token.objectClass { /** @override */ get isVisible() { - // Fixes #9521 in V10 - this.detectionFilter = undefined; - const visible = super.isVisible; if (!visible && active || visible && this.document.hidden) { @@ -123,7 +120,7 @@ Hooks.once("init", () => { vTextureCoord = (aVertexPosition * outputFrame.zw) * inputSize.zw; vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.0)) + outputFrame.xy; vec2 offset = position - origin; - vOffset = (offset.x + offset.y) / (2.0 * thickness); + vOffset = (offset.x + offset.y) / (1.414213562373095 * 2.0 * thickness); gl_Position = vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } `; @@ -167,7 +164,7 @@ Hooks.once("init", () => { const hatchFilter = HatchFilter.create(); - if (foundry.utils.isNewerVersion(game.version, 12)) { + if (game.release.generation >= 12) { Hooks.on("drawCanvasDarknessEffects", (layer) => { const index = layer.filters?.indexOf(layer.filter); @@ -233,7 +230,7 @@ Hooks.once("init", () => { } }; - if (foundry.utils.isNewerVersion(game.version, 11)) { + if (game.release.generation >= 11) { Hooks.once("setup", setup); } else { Hooks.once("setup", () => {