Commit f27cce8f authored by Brunhine's avatar Brunhine
Browse files

2.4

parent 3f148381
# 2.4
- Fix for marker misbehaving when token vision is disabled for a scene
- Fix for marker being visible when tokens are hidden
# 2.3
- Marker should now be hidden when the active combatant is hidden
......
......@@ -3,7 +3,7 @@
"title": "Turn Marker",
"description": "Displays a (optionally animated) marker on the token who's active turn it is.",
"author": "Brunhine",
"version": "2.3",
"version": "2.4",
"minimumCoreVersion": "0.5.5",
"compatibleCoreVersion": "0.5.5",
"esmodules": [
......@@ -12,5 +12,5 @@
"scripts": [],
"url": "https://gitlab.com/brunhine/foundry-turnmarker",
"manifest": "https://gitlab.com/brunhine/foundry-turnmarker/raw/master/turnmarker/module.json",
"download": "https://gitlab.com/brunhine/foundry-turnmarker/-/jobs/artifacts/2.3/raw/turnmarker.zip?job=build"
"download": "https://gitlab.com/brunhine/foundry-turnmarker/-/jobs/artifacts/2.4/raw/turnmarker.zip?job=build"
}
\ No newline at end of file
......@@ -59,11 +59,13 @@ Hooks.on('updateToken', (scene, updateToken, updateData) => {
});
Hooks.on('updateTile', () => {
let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);
if (tile) {
let combatant = canvas.tokens.placeables.find(x => x.id == game.combat.combatant.tokenId);
if (combatant) {
tile.visible = canvas.sight.testVisibility(combatant.center, { tolerance: canvas.dimensions.size / 4 });
if (canvas.scene.data.tokenVision) {
let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);
if (tile) {
let combatant = canvas.tokens.placeables.find(x => x.id == game.combat.combatant.tokenId);
if (combatant && !combatant.data.hidden) {
tile.visible = canvas.sight.testVisibility(combatant.center, { tolerance: canvas.dimensions.size / 4 });
}
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment