PhilippeKr / TorchLight

Slightly enhanced Torch and Light Module for Foundry VTT, based on the excellent work of RealDeuce on the Torch Module.
4 stars 18 forks source link

Further 0.8 fixes #34

Closed cs96and closed 3 years ago

cs96and commented 3 years ago

Get initial lighting information from token.data, rather than token.lighting.

Data in token.lighting may not be complete if the token has never had lighting enabled on it. Also, the data is restored to token.data (via token.document), so it makes sense that that is the location it is initially saved from.

mr-barakas commented 3 years ago

The new code is working for me. Very nice work!

Haladesta commented 3 years ago

It seems to work for me now as well mostly. The only thing is that when it reads the light color in the token to store it when enabling the light, it throws an exception whenever the field for light color is empty.

torchlight.js:431 Initialisation torchlight.js:96 Clicked on the light button when the light is off.

torchlight.js:375 Uncaught (in promise) TypeError: Cannot read property 'toString' of undefined at storeTokenLighting (torchlight.js:375) at onButtonClick (torchlight.js:104)

storeTokenLighting @ torchlight.js:375 onButtonClick @ torchlight.js:104

Edit: actually it seems to also be related to the emission distance. Here's a short video that shows it: https://drive.google.com/file/d/1E0GWobqlAoMDis18Rysuol7m6ooaofGi/view?usp=sharing

cs96and commented 3 years ago

@Haladesta, I'm not sure you are using the latest version, as the line numbers mentioned in the console messages are off. E.g. toString() is called on line 377, not 375, and is guarded with an undefined variable check.

Haladesta commented 3 years ago

Ahh, ok sry I found it. I didn't know I had to look at your repo instead of this one. Works now 👍

PhilippeKr commented 3 years ago

Many thanks, it seems to be working for me as well, let me prepare the packaging, I'll try to upload is shortly.

PhilippeKr commented 3 years ago

OK, I have created version 0.10.0, and uploaded it to Foundry, it seems available and working well. Thanks for all the help !

cs96and commented 3 years ago

@PhilippeKr, thanks for doing the release. I notice on the foundry page you have marked v0.10.0 as compatible with foundry version 0.7.5 to 0.8.6... https://foundryvtt.com/packages/torchlight/

However I don't think the latest changes are compatible with 0.7.x. You will need to continue using v0.9.0 for 0.7.x.

I changed the module.json manifest to only be compatible with 0.8.6 - 0.8.7

cs96and commented 3 years ago

Also, I noticed that the .zip file contains an .archive folder and two temporary files (ziCHO0u1 and ziDOEkw1) which appear to be zip files themselves.

Not a major issue, but just bloats out the module.

PhilippeKr commented 3 years ago

You're right, it was a field that is too much on the right on the Foundry form, which made me miss it, it is hopefully corrected. And I've modified the .zip as well, although the bloating really comes from the images in the doc folder, I have uploaded a new version, let me know if it's OK.