Farratto
January 8th, 2025, 18:52
I've been updating coreRPG Combat Highlighter extension and it was having a problem when tokens are too close to each. Primarily with partial overlapping, but also if they are just adjascent and you're moving the mouse quickly. It will not call every Token.onHover API that it should (i.e. it should call for each time the mouse hovers over a token and again when it hovers off the token). I've been working around this by keeping track of what gets hovered and deducing missed onHover calls. But I thought I would let you know in case it is something you'd like to fix.
Expected Behavior: Hovering over two tokens in rapid succession calls (in series) Token.onHover(tokenA, true), Token.onHover(tokenA, false), Token.onHover(tokenB, true)
Observed Behavior: Hovering over two tokens in rapid succession calls (in series) Token.onHover(tokenA, true), Token.onHover(tokenB, true)
Steps to recreate:
1.) place tokenA
2.) place tokenB with partial overlap of tokenA
3.) load extension with following code
4.) move mouse over tokenA and then tokenB
5.) check console log
fonHover = '';
function onInit()
fonHover = Token.onHover;
Token.onHover = onHoverNew
end
function onHoverNew(target, state)
if state then
Debug.console("onHover true");
else
Debug.console("onHover nil or false");
end
fonHover(target, state);
end
Expected Behavior: Hovering over two tokens in rapid succession calls (in series) Token.onHover(tokenA, true), Token.onHover(tokenA, false), Token.onHover(tokenB, true)
Observed Behavior: Hovering over two tokens in rapid succession calls (in series) Token.onHover(tokenA, true), Token.onHover(tokenB, true)
Steps to recreate:
1.) place tokenA
2.) place tokenB with partial overlap of tokenA
3.) load extension with following code
4.) move mouse over tokenA and then tokenB
5.) check console log
fonHover = '';
function onInit()
fonHover = Token.onHover;
Token.onHover = onHoverNew
end
function onHoverNew(target, state)
if state then
Debug.console("onHover true");
else
Debug.console("onHover nil or false");
end
fonHover(target, state);
end