mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Using debouncing to fix an issue with selected and unselecting targets
This commit is contained in:
parent
d86c7b96ce
commit
a7abc589f2
1 changed files with 4 additions and 3 deletions
|
|
@ -305,13 +305,14 @@ const updateAllRangeDependentEffects = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
const debouncedRangeEffectCall = foundry.utils.debounce(updateAllRangeDependentEffects, 50);
|
||||
|
||||
Hooks.on('targetToken', async (user, token, targeted) => {
|
||||
// TODO: There is a bug when you untarget one token and retarget a new one
|
||||
await updateAllRangeDependentEffects();
|
||||
debouncedRangeEffectCall();
|
||||
});
|
||||
|
||||
Hooks.on('moveToken', async (movedToken, data) => {
|
||||
await updateAllRangeDependentEffects();
|
||||
debouncedRangeEffectCall();
|
||||
});
|
||||
|
||||
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue