kandashi / Active-Token-Lighting

MIT License
24 stars 24 forks source link

Better object value support for other modules #150

Open kaelad02 opened 10 months ago

kaelad02 commented 10 months ago

Is your feature request related to a problem? Please describe. There is a module that stores some data in flags on a token that would like to replace the entire object via an active effect instead of listing it's properties individually. For example, you could create an active effect like:

ATL.flags.levels-3d-preview | Custom | {particleType: "fire", intensity: 1}

that would replace the entire 3d-preview object instead setting the particleType and intensity properties separately. That would also ensure if there was an existing object there on the token, it'd be entirely overwritten rather than just changing those two properties (in case there were extra properties already there).

Describe the solution you'd like I'd like to set that key as an object just like you can set ATL.light.animation. Somehow make that specific object solution generic so it can be used by other 3rd-party keys. Not sure if the best way is to have a list of them in the switchType function or check the value to see if it's an object to determine that so we don't need a "pre-approved" list.

Describe alternatives you've considered Setting the properties individually works when the object isn't already there, but if it is and other properties in the object might be set, they'd survive.

Additional context This was a request from @theripper93 over Discord.