From 8f3c0703e8bf1f47c37f29b01a69d7eb338fda41 Mon Sep 17 00:00:00 2001 From: Andre / STB Date: Sat, 25 May 2024 17:35:24 +0200 Subject: [PATCH] =?UTF-8?q?Anpassungen=20f=C3=BCr=20Foundry=20V12=20Releas?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NotYourTurn.js | 12 +++++------- README.md | 2 +- changelog.md | 3 +++ module.json | 7 ++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/NotYourTurn.js b/NotYourTurn.js index 152b141..c872736 100644 --- a/NotYourTurn.js +++ b/NotYourTurn.js @@ -60,17 +60,15 @@ Hooks.on("canvasReady",(canvas) => { NYTTcontrolledTokens = []; NYTTokenPositionMap.clear(); - // While on canvasReady in V10 X/Y of token was already filled with correct value, in V11 it is at CanvasReady still 0/0. So we need to track position later when set, seem to exist on first refreshToken. - // We can use the refreshToken in V11 globally since coords still the old before movement while in V10 already the new position (which would move token to actual position on Undo instead of back) + // While on canvasReady in V10 X/Y of token was already filled with correct value, in V11/V12 it is at CanvasReady still 0/0. So we need to track position later when set, seem to exist on first refreshToken. + // We can use the refreshToken in V11/V12 globally since coords still the old before movement while in V10 already the new position (which would move token to actual position on Undo instead of back) // Overall: V10 and V11 act different in token positions if (game.version.startsWith("10")) { storeAllPositions(NYTTokenPositionMap, canvas); - } - - if (game.version.startsWith("11")) + } else { - Hooks.on('refreshToken', OnRefreshTokenV11); + Hooks.on('refreshToken', OnRefreshTokenV11AndLater); } let allocatedTokenLayer = AllocateCorrectTokenLayerOnCanvas(canvas); @@ -159,7 +157,7 @@ Hooks.on('controlToken', (token,controlled)=>{ }); -function OnRefreshTokenV11(token) +function OnRefreshTokenV11AndLater(token) { if (token.controlled || token.isOwner) { NYTTokenPositionMap.set(token.id, {x:token.x,y:token.y}); diff --git a/README.md b/README.md index 8fce844..8e87fff 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ The operation of the module can be modified in the module settings. Here is an o ![moduleSettings](https://github.com/STBaf/NotYourTurn/blob/master/img/examples/ModuleSettings.png) ## Software Versions & Module Incompatibilities -Foundry VTT: Tested on v10 and v11
+Foundry VTT: Tested on v12, v11 and v10
For support of Foundry Version 0.7.9 - 9.280 use earlier versions 1.1.5 up to 1.2.8 of this module
Module Incompatibilities: None known
diff --git a/changelog.md b/changelog.md index 23f8d79..90166a6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Changelog +### v2.2.0 - 25-05-2024 +Adding support for Foundry v12 + ### v2.1.4 - 18-09-2023 Fixing undefinied layer bug for scenes without tokens diff --git a/module.json b/module.json index 37161da..f799324 100644 --- a/module.json +++ b/module.json @@ -3,8 +3,8 @@ "name": "NotYourTurn", "title": "Not Your Turn!", "description": "Block token movement if it's not the token's turn.", - "version": "2.1.4", - "authors": [{ + "version": "2.2.0", + "authors": [{ "name": "STB", "url": "https://www.stbaf.de", "email": "andre@stbaf.de", @@ -15,7 +15,8 @@ "minimumCoreVersion": 10, "compatibility": { "minimum": "10", - "verified": "11" + "verified": "12", + "maximum": "12" }, "languages": [ {