From b4926d6681e2f922248e52e082376e8ffce865f6 Mon Sep 17 00:00:00 2001 From: Marcel Veldhuizen Date: Sat, 3 Jun 2023 14:57:52 +0200 Subject: [PATCH] Support Foundry v11 alongside v10 Fixes #49 --- js/pixi/container.js | 9 ++++++--- module.json | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/pixi/container.js b/js/pixi/container.js index f1f8995..043056a 100644 --- a/js/pixi/container.js +++ b/js/pixi/container.js @@ -87,9 +87,12 @@ export class PointerContainer extends PIXI.Container { } getMouseWorldCoord() { - return canvas.app.renderer.plugins.interaction.mouse.getLocalPosition( - canvas.stage - ); + if (canvas.app.renderer.events) { + // PixiJS 7 (Foundry VTT 11) + return canvas.app.renderer.events.pointer.getLocalPosition(canvas.stage); + } + + return canvas.app.renderer.plugins.interaction.mouse.getLocalPosition(canvas.stage); } ping({ diff --git a/module.json b/module.json index 6d1bbcf..08e903a 100644 --- a/module.json +++ b/module.json @@ -26,8 +26,8 @@ ], "compatibility": { "minimum": "10", - "verified": "10.285", - "maximum": "10" + "verified": "11.300", + "maximum": "11" }, "socket": true, "manifest": "https://raw.githubusercontent.com/Moerill/fvtt-pointer/master/module.json",