mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 05:31:07 +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) => {
|
Hooks.on('targetToken', async (user, token, targeted) => {
|
||||||
// TODO: There is a bug when you untarget one token and retarget a new one
|
debouncedRangeEffectCall();
|
||||||
await updateAllRangeDependentEffects();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Hooks.on('moveToken', async (movedToken, data) => {
|
Hooks.on('moveToken', async (movedToken, data) => {
|
||||||
await updateAllRangeDependentEffects();
|
debouncedRangeEffectCall();
|
||||||
});
|
});
|
||||||
|
|
||||||
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue