-
January 20th, 2022, 00:34 #1
- Join Date
- Jan 2020
- Posts
- 280
Token selection timing, select after double-click
Following up on my post from yesterday about working on double-click to target, I am now attempting to select the active token after completing the double-click. As I complete the "set target," I have the owner look up their token's active window and select it. This process works when there are no clicks involved (I use the same function when moving between turns, to auto-select the active token), but with a double-click, it becomes apparent that the timing of mouse click handling is in play here. I'm pretty sure this is just not practicle to fix, but maybe there is a trick I don't know about!
You can see a video of it in action here:
https://www.loom.com/share/0cbe7a8e0...041c99785c03fc
And the relevat select-self code:
Code:function toggleSelectedToken(bSelect) local nodeActive = CombatManager.getActiveCT(); if not DB.isOwner(nodeActive) then return; end local nodeCT = CombatManager.getTokenFromCT(nodeActive); local container = ImageManager.getImageControl(nodeCT, false); Debug.chat('rcv token select', bSelect, nodeActive); if nodeCT and container then container.clearSelectedTokens(); container.selectToken(nodeCT, bSelect); end end
-
January 20th, 2022, 00:42 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,558
At this point, I don't think it's something that we will be looking at adjusting. Any time you change the ordering of triggers/scripts, you can have unintended knock-on effects to existing behaviors.
My guess is that the actual token "selection" updating is happening after the script; but I would have to go rooting around in the code that @cpinder maintains (and he is currently away for a bit).
Regards,
JPG
-
January 20th, 2022, 00:49 #3
- Join Date
- Jan 2020
- Posts
- 280
Fair enough. I know it's a funky thought, but there's no way to callback after a delay in FG, is there? I could see postponing the self-select for 100ms or something goofy like that. Part of me hopes the answer is no
-
January 20th, 2022, 17:36 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,558
No, that would require a whole event tracking system that works differently than it works before. I know that there are several scripts that are dependent on events happening inline with UI actions and API call events.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks