mrcomac / token-action-hud-swade

FoundryVTT Token Action HUD for Savage Worlds
MIT License
5 stars 4 forks source link

Updated the effects section to grab the actual label and localize it #38

Closed ddbrown30 closed 3 months ago

ddbrown30 commented 3 months ago

This change makes the status effects human readable and localized. Prior to this, it was just using the effect ids which was especially a problem with effects added through SUCC as they have a generated GUID. This also required the removal of the toLower on the id compare which was unnecessary and would have broken on any status effect with an id that wasn't lowercase since defaults_statuses is populated directly from CONFIG.statusEffects anyway.

As an aside, IMO it would be cleaner if _effects and everything down the chain just used the contents of statusEffects rather than the ids. Right now, we convert the array of effects into an array of ids and then use that array of ids to look up the effect back in the original array. I wanted to minimize my changes, though, so I left it as is. Just a suggestion for something to look at if you're looking to clean up the code at any point.

ddbrown30 commented 3 months ago

I just noticed that attributes have the same issue. Assuming you take this PR, I'll make another that fixes those to be localized as well.

mrcomac commented 3 months ago

Are you able to raise the PR with both changes? I'll be happy to merge both changes in one PR. thanks for heping :)

ddbrown30 commented 3 months ago

Sure thing. It shouldn't take me long. I'll try to get it done tomorrow. Happy to help. 🙂

ddbrown30 commented 3 months ago

There you go. Let me know if you have any questions.

mrcomac commented 3 months ago

I need to adjust other stuffs an I'll release this change soon. Thanks for the help.