STAR TREK 2d20
  1. #1

    Get window reference of ct_entry given the node

    Last night after doing an effect plugin, I tried to look for for a way to do another CT plugin but got stumped.

    The general Idea is that given a Node of a ct_entry/ct_client_entry, how do I then properly get the window instance of it to utilize window functions on it? Unlike something global, or opening a generic window, I wish to get the ct_entry or ct_client_entry, window within the combat tracker.
    Last edited by Ken L; December 2nd, 2017 at 02:24.

  2. #2
    The closest solution I can get now after unboxing this from another angle, is to grab the entire combat tracker window via findWIndow, and use a ct_entry unique identifier to zone in on the entry. This way you'll automatically have the windowlist of ct_entry, and you can cherry pick from the node data.

    It's easy to get the node data if you have the window, but it's difficult to re-acquire it if you only have the node data and it's non-unique.

    The only identifying data is something like a token ID so going from the map to the CT is solved. Outside of that it gets fuzzy.

  3. #3
    The CT child node is unique to each window. The only solution is to grab the CT window using Interface.findWindow, and then iterate through the list windows to find the window with the same DB node path.

    That’s why all of the CT controls write to the database, so that grabbing the window is unnecessary for the vast majority of needs. The updates to he CT database node should automatically reflect in the CT entry controls.

    Perhaps an example of what you are trying to accomplish where you need a CT entry window, instead of a CT node?

    Regards,
    JPG

  4. #4
    The idea was a quick snap CT to selected token extension. Tuesday I had a combat with 30+ combatants and when an AoO was triggered, The tokens were geographically next to each other, but scattered all over the tracker making accessing their effects a PITA. This is to raise the quality of life by allowing me to select the token and snap the CT to that entry for further examination.

  5. #5

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    What did you the user do in order to cause the snap-to-token effect to occur? Are you going to post an extension on this? Sounds very useful.

  6. #6
    I was planning on doing this but hadn't gotten around to it. I imagine it was something to do with getting the CT entry associated with the token, then finding the window the entry is in then using windowlist.scrollToWindow.
    I never claimed to be sane. Besides, it's more fun this way.

  7. #7
    It works, the DBNode path was a direct hit for what I needed; thanks moon. Just a little filtering will do. Nick's pretty much on the dot for what I wanted. The scroll seek needs a visual aid, so chances are I'm going to do some highlighting of the entry to make it easier to find. The goal is to reduce the amount of time during 'look up'.

    As for releasing it, someday perhaps. I have a number of extensions I haven't been releasing for reasons my core players know about, but it's easy enough to write (less than 20 or so lines or 50 expanded) of logic.

  8. #8

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Can we sweet talk you into posting your code then? There seems to be an informal agreement around here that we try to post solutions to anything we discussed on the boards, particularly if someone helped sort out the problem.

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
  •  
5E Character Create Playlist

Log in

Log in