5E Product Walkthrough Playlist
  1. #1

    How to be notified of Selection changes?

    Hi everyone,

    I was wondering if there is any API functionality to get notified of selection changes.
    I would love something like imagecontrol.onSelectionChanged(...) or tokeninstance.onSelect(...). Nothing like this is documented in the API, but the doc is sometimes behind what is actually available. AFAIK selection state is also not stored in the DB, so DB.addHandler(...,"onUpdate",...) won't help either.

    Failing that, what would be good opportunities to poll imagecontrol.getSelectedTokens to check for changes myself? tokeinstance.onClickRelease does not work, since the selection is updated only after the click event is fully processed. Same goes for imagecontrol.onCursorModeChange (again imagecontrol.getSelectedTokens gives the old selection).

    The only other thing I could think of would be to use imagecontrol.onHover and tokeninstance.onHover, but that will be a lot of polls, comparing possibly large tables. I'm worried about the performance impact here.

    Anyone have an idea or suggestion?
    Check out my Extensions for Savage Worlds:
    Arcane Devices:Forge and github
    Mass Battles: Forge and github
    Fast Tests: Forge and github
    Reload Consumption: Forge
    Chase&Combat Compilation: Forge

  2. #2
    There are no events in the API for this UI action.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in