Open gioppoluca opened 3 years ago
Hi, i'm not a developer but I figured out a "solution" when I encountered this situation. On the torchlight.js file on the module folder, I changed the line 367 inside the function storeTokenLighting:
app.object.setFlag("torchlight", "InitialLightColor", app.object.light.color);
to:
app.object.setFlag("torchlight", "InitialLightColor", "");
Based in my understanding, the "remember the last config" thingy was messing with setting of the "new" color hex. But I don't really know haha
@eduardopato41 Thank you for this. I actually took a look into the code myself and found that it seems that line is no longer 367, but 376. Can you please confirm how to fix the specific promises.push(app.object.document.setFlag("torchlight", "InitialLightColor that is below?
// Store the initial status of illumination for the token to restore if all light sources are extinguished async function storeTokenLighting() { let promises = []; const tokenData = app.object.data; promises.push(app.object.document.setFlag("torchlight", "InitialBrightRadius", tokenData.brightLight)); promises.push(app.object.document.setFlag("torchlight", "InitialDimRadius", tokenData.dimLight)); promises.push(app.object.document.setFlag("torchlight", "InitialLightColor", tokenData.lightColor ? tokenData.lightColor.toString(16).padStart(6, 0) : null)); promises.push(app.object.document.setFlag("torchlight", "InitialColorIntensity", Math.sqrt(tokenData.lightAlpha))); promises.push(app.object.document.setFlag("torchlight", "InitialLightAngle", tokenData.lightAngle)); promises.push(app.object.document.setFlag("torchlight", "InitialAnimationType", tokenData.lightAnimation.type ?? null)); promises.push(app.object.document.setFlag("torchlight", "InitialAnimationSpeed", tokenData.lightAnimation.speed)); promises.push(app.object.document.setFlag("torchlight", "InitialAnimationIntensity", tokenData.lightAnimation.intensity));
Works correctly but a couple of test of activating de-activating and so on the module stop working with this error: