Skip to content

Commit

Permalink
Anpassungen für Foundry V12 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
STBaf committed May 25, 2024
1 parent ecc9b2b commit 8f3c070
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 5 additions & 7 deletions NotYourTurn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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});
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<b>Foundry VTT:</b> Tested on v10 and v11<br>
<b>Foundry VTT:</b> Tested on v12, v11 and v10<br>
For support of Foundry Version 0.7.9 - 9.280 use earlier versions 1.1.5 up to 1.2.8 of this module<br>
<b>Module Incompatibilities:</b> None known<br>

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
7 changes: 4 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
Expand All @@ -15,7 +15,8 @@
"minimumCoreVersion": 10,
"compatibility": {
"minimum": "10",
"verified": "11"
"verified": "12",
"maximum": "12"
},
"languages": [
{
Expand Down

0 comments on commit 8f3c070

Please sign in to comment.