Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes:
#45
Some refactoring was done on the function handling combat updates as well.
Usage:
No real changes, will properly update when a new combat round is done in SWADE. Note that there may be a short moment where the marker jumps to the correct new actor. It's a limitation and not fixable with my current knowledge/additions to the SWADE system
Tech notes:
While SWADE does emit a socket signal:
game.socket.emit('system.swade', { type: 'newRound', combatId: this.id });
I'm having difficulty picking it up with a
Hooks.once('ready'
for some reason. I'm not sure whether there's no cross module support in foundry or if I'm doing something wrong, but the lack of foundryvtt documentation hasn't cleared it up for me.There's also no hook fired when a new round is created (the function that SWADE overrides to reshuffle initiative), with that said, I've had to resort to hooking into the
renderCombatTracker
hook, which would get fired after each turn update + each round update. It's not the most ideal solution, considering how there are multiple emits for that hook, but its the best that can be done without a proper hook, and no access to the socket.The logic checks for the SWADE system specifically, so normal functionality won't be affected.