Closed macskay closed 1 year ago
Nice! Thank you for investigating!
Instead of changing the composite function so that it only works with v11, could you do something like an if statement to determine if v11, do the new way, vs if v10 use the old method?
Something like
if (isNewerVersion(game.version, "10.299") ) {
doNew
} else {
doOld
}
Yes of course! Done. Added the clause and bumped the version number
What exactly is not working? Beware, that the fix has not yet been merged back into the main repository, thus it is not available if you don't install it manually with the specific branch.
Just tested it with 11.302 and the fix still works. Proof:
Due to increasing demand of this fix I uploaded a temporary release to my repository that can be downloaded and manually installed. https://github.com/macskay/simplefog/releases/tag/v11-fix
Beware that I will delete this release as soon as the PR I opened for this fix is merged back to the main repository.
This patched version seems to have a problem, I cant select single tokens by clicking when its active in the latest foundry v11.
This patched version seems to have a problem, I cant select single tokens by clicking when its active in the latest foundry v11.
Have you tested this in combination with other modules or alone? If not alone, I would suggest using Find the Culprit to help narrow down if this is a combination of modules or SimpleFog itself, but.. well.. this issue stops that. You could still attempt to do the process manually though
This is the only module active when testing. While the module works just fine manipulating the fog, when its active, tokens cant be manipulated moved or selected. Its like there's some kind of layer over the tokens that I can't see. Some errors from the console when I activate it :
Foundry VTT | Drawing the SimplefogHUDControlLayer canvas layer foundry.js:5760 Foundry VTT | Rendering HeadsUpDisplay index.mjs:1 PixiJS Deprecation Warning: Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead.Deprecated since v7.2.0 commons.js:2004 Error: You are accessing BasePackage#data which is now deprecated in favor of referencing schema fields directly on the BasePackage instance. Deprecated since Version 10 Backwards-compatible support will be removed in Version 12 at logCompatibilityWarning (commons.js:1993:19) at get data [as data] (commons.js:13978:7) at SimplefogNotification.checkVersion (SimplefogNotification.js:11:91) at readyHooks (simplefog.js:61:24) at Object.fn (main.js:44:2) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at Game.setupGame (foundry.js:8684:11) at async Game._initializeGameView (foundry.js:9925:5) at async Game.initialize (foundry.js:8588:5) logCompatibilityWarning @ commons.js:2004 get data @ commons.js:13978 checkVersion @ SimplefogNotification.js:11 readyHooks @ simplefog.js:61 (anonymous) @ main.js:44
callAll @ foundry.js:687 setupGame @ foundry.js:8684 await in setupGame (async) _initializeGameView @ foundry.js:9925 _initializeView @ foundry.js:9901 initialize @ foundry.js:8588 await in initialize (async) window.addEventListener.once @ foundry.js:90585 foundry.js:7620 Foundry VTT | Retrieved and compiled template templates/hud/hud.html worker.js:73 Worker Compressor | Initialized Worker
The fix does not erase existing underlying problems. It only makes it work with Foundry 11 again, so you can actually use it at all.
@macskay In your testing, are you experiencing the problems in https://github.com/League-of-Foundry-Developers/simplefog/issues/107#issuecomment-1597993831 ?
The testing I did yet was exhibiting this, and I haven't been able to come up with an obvious problem. Since moving the SimpleFogLayer zIndex to below the Token layer allows selection of the token, it makes me think it's something with transparent areas of the SimpleFogLayer not propagating click events down to the token layer. Mouseover seems to be propagating since the cursor changes to a finger-pointer and the token gets a surround. I don't see anything different between the v10 and v11 InteractiveCanvasLayer, so I don't think it's that.
This makes sure that simplefog can be used with Foundry v11. Foundry now uses Pixi.js v7 and due to that change the MaskLayer.ts needs an update on how to call the Renderer's render function.
Release Note 11.293 for Pixi.js v7: https://foundryvtt.com/releases/11.293 Can be found under Web Workers Upgrading Our PIXIes
API Documentation of latest PIXI.CanvasRenderer of latest release can be found under: https://pixijs.download/release/docs/PIXI.CanvasRenderer.html#render
For this purpose I moved the options to their own object and passed in the newly created options object to the render function. Now simplefog works again.
Proof:
This affects issue #107
Tested with Version 11.301