Frstrm / TokenLightCondition

Determine the lighting conditions of a token based on placed lights and token lights
MIT License
1 stars 4 forks source link

[Feature Request] Make effect generation optional and add flags #23

Closed p4535992 closed 1 year ago

p4535992 commented 1 year ago

Make effect generation optional and add setting of specific flags

The purpose is that effect generation may be redundant or tedious in some cases, but it would be convenient to retrieve the value to apply certain rules on the flags system . from the standard module api model exposed by : game.modules.get('tokenlightcondition').api.

If effect behaviour and flags bhaviour are both enabled they should be sync.

Here some example:

let tokenId = token.id;

// Retrieve light condition from Effect or Flags
game.modules.get('tokenlightcondition').api.getLightCondition(tokenId) // DRK, DIM, BRT

let lighCondition = "DIM";

// Check only effect
game.modules.get('tokenlightcondition').api.hasEffectLightCondition(lighCondition:string) // true , false

// Check both effect and flags
game.modules.get('tokenlightcondition').api.hasLightCondition(lighCondition:string) // true , false
Frstrm commented 1 year ago

In the settings, if you set the 'Source for light effect' to Disable Token Effect. This will disable the effects being placed on the tokens. However the token is still being processed, and the information being stored. This is how the TokenHud still functions without the effects being placed.

I believe this information can already be found via token effect flags information the info is stored at: token.actor.flags.tokenlightcondition.lightLevel or call: token.actor.getFlag('tokenlightcondition','lightLevel')

image

p4535992 commented 1 year ago

A ok ty for the clarification ! i still think a API is still useful, but a flag is just enough.

Frstrm commented 1 year ago

It's certainly something I can look into, but hasn't been on my radar until now.