illandril / FoundryVTT-token-hud-scale

MIT License
5 stars 2 forks source link

Keep preferred ordering for status effect icons #26

Closed mjeffw closed 3 years ago

mjeffw commented 3 years ago

My system has a special status effect icon, which should always be displayed first in the list.

In the base Foundry code, I've accounted for this via patching the Actor.temporaryEffects property to return the list of actor.effects in the preferred order.

When using Illandril's Token HUD Scaler -- which I love, BTW -- the order defaults back to the order in which the effects appear in the actor.effects.

Is there something either you or I could do to have Illandril's Token HUD Scaler respect the same order as applied via Actor.temporaryEffects?

illandril commented 3 years ago

Can you point me to the specific system/module you're using, and the specific effects that are out of order? I'd prefer to test any change I make with the exact setup that has an issue as opposed to making a blind change.

mjeffw commented 3 years ago

The support for these changes are not published yet.

Here's the source code repo and branch:

(https://github.com/crnormand/gurps/tree/feature/misc-updates)

You can see the override for Actor.temporaryEffects in file module/actor/maneuver.js, line number 376.

Basically, an effect whose statusId (effect.getFlag('gurps', 'statusId')) is "maneuver" must be the first one drawn, so that it appears in the upper left corner of the token.

mjeffw commented 3 years ago

Here's a demo of the behavior with and without the Token HUD Scaler module: https://studio.youtube.com/video/P5kqc3DyJ48/edit

illandril commented 3 years ago

I've already reproduced it and know what the fix will be, I just haven't quite had enough time yet to finish the fix. I'll hopefully have time this weekend.