DICE PACKS BUNDLE
  1. #1

    How do you find the correct database node name to use in general?

    I'm trying to get access to the chat and modifier stack windows.
    I've found their windowclass names, but I don't know exactly how I would go about to find what database nodes they are using. And I need those to be able access the correct windowclass.

    Tried to call it unbound, that is with a nil reference, with 'self', and the same as the window class names, just in case. But needless to say it didn't work. Worth a try though right lol.

    Here is a code snipped of what I'm doing, but I'm missing the nodes, the ('???') placeholders.

    Code:
    local wChat = Interface.findWindow('chat', '???');
    local wModifiers = Interface.findWindow('modifierstack', '???');
    Using these without the right node returns the 'chat' panel, rather than the fully fledged chat windowclass for example.

    How do you find out the nodename you want in each case?
    And rather in general how do I track down the nodenames for the various things I might do?

    Cheers, Styrmir.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (development and support on hold for now)

    Combat Enhancer 5E Classic (no longer officially supported, community support only)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    The first step I always do when I'm dealing with database nodes is look in the relevant database - the module db/client.xml file, or the campaign db.xml file. For the campaign database, enter some sample data in the window/control you're interested in, and then issue the chat command /save just before looking at the file.

    For the two entities you mention (chat window and modifier stack) these don't actually store any data in the database, there's nothing in db.xml - the data is stored in memory. If you restart FG you will lose any data stored in them. There is a slight exception - the GM chat data is stored in the chatlog.html file in the campaign directory.

    Therefore, you can't use the findWindow to get to these controls. You'll need to use the relevant global script packages (if they exist) to access data within these panels:

    - desktop\scripts\modifierstack.lua for the modifier stack data, which has a global package name of ModifierStack
    - scripts\manager_chat.lua for the base chat window operations. The global package name is ChatManager. There are also some chat operations you can do via the built in Comm package: https://www.fantasygrounds.com/refdoc/Comm.xcp
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    I haven't tried it, because I haven't had a need; but you should be able to access those two windows as:
    Interface.findWindow("chat", "");
    Interface.findWindow("modifierstack", "");

    Not sure that messing with the windows at the Lua level will be very useful. It really depends on what you're trying to do, which you didn't mention.

    Regards,
    JPG

  4. #4
    @Trenloe

    Much appreciated approach for tracing the nodes in question and your detailed reply!

    I had managed to figure out the global package names from the CoreRPG base.xml and the Comm. Starting to get better at this after all these hours spent on it and the help from the community.

    In this case though, I'm trying to manipulate the actual window instances rather than their contents, as you'll see below.

    Perhaps I should have given more details in the original post. I had figured I'd be able to solve the rest if I could get my hands on the windows properly. Also I was also trying to learn more in general, to have the general toolset understanding available, rather than a singular solution. Which you gave me with your /save suggestion.

    I'll keep that in mind, it might be helpful for you all to be able to answer, if given a more specific criteria of what I'm trying to accomplish.



    @Moon Wizard

    What I'm trying to do is to set up a menu option choice, that would give the players and host the option of keeping the chat box and dice modifiers on top when a background image is set as full screen.

    I figured I'd try to grab the window then call the window windowinstance.bringToFront() function if that option has been set in the menus. Such as.

    Code:
    local wChat = Interface.findWindow('chat', '');
    local wModifiers = Interface.findWindow('modifierstack', '');
    
    -- bring windows to front
    wChat.bringToFront();
    wModifiers.bringToFront();
    In the instance above though when called, it will return an error for the bringToFront() function similar to, "bringToFront: Panel display order can not be changed".
    And as I'd found:

    From CoreRPG /desktop/desktop_classes.xml : <windowclass name="chat">

    And

    From CoreRPG /desktop/desktop_panels.xml : <panel name="chat" modes="host">

    It sounded like the error message was due to the panel having been captured, rather than the windowclass. So it stood to reason that what I was missing was a correct instance of the windowclass, and as there can only be one active windowinstance with the same parameters at a time.

    Quote from refdoc windowinstance:
    These parameters identify a window instance uniquely, i.e. a second window with the same parameters cannot exist. Thus, only one unbound instance of a particular window class can ever exist at one time.

    My thought process was that it had to be because I was not passing the correct database node reference to the API for it to find the correct window.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (development and support on hold for now)

    Combat Enhancer 5E Classic (no longer officially supported, community support only)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  5. #5
    The way that it works is that any panel definition will instantiate a windowinstance with the panel attribute. Any windows created from that point forward are windowinstances without the panel attribute. They have the same APIs.

    Panel layout is completely determined by the panel definitions; which define the layout of the panel windows within the desktop area. The windows which are not panels are always floating on top of desktop and panels. Certain APIs work differently or are disabled depending on the panel attribute of the windowinstance.

    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
  •  
Starfinder Playlist

Log in

Log in