5E Product Walkthrough Playlist
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by Bidmaron View Post
    Celestian, I usually give up and create a temporary node in these cases because I can never walk back up very far. I create the node and then delete it when I'm done. A kluge, but I get brain damage trying to walk up window/subwindow hierarchies like that.
    It is quite the challenge but this kinda thing sucks me in and makes me figure it out. Makes it easier down the road when I need to do it again... you are right tho the temporary node would make it a lot easier

    Quote Originally Posted by Trenloe View Post
    The "Scope" section here might also give you some ideas: https://www.fantasygrounds.com/wiki/...pt_Block_Scope

    For this you're probably going to need something like: window.parentcontrol.window.parentcontrol.window
    You are correct. The way I figured it out was really kludgy but it worked.

    So the first thing I did was call what I knew was valid from "ready_check_entry_user" in a <script> section like this.

    function onButtonPress()
    local sName = User.getUsername();
    window.parentcontrol.readyPressed(sName,1);
    end

    Then at main_user I added another script section with the same code (the above is sent to main_user <script>)

    function readyPressed(sUser,nCheck)
    Debug.console("utility_readycheck.xml","main_user" ,"TESTING");
    window.parentcontrol.readyPressed(sUser,nCheck);
    end

    and then in "main"

    function readyPressed(sUser,nCheck)
    Debug.console("utility_readycheck.xml","main","TES TING");
    window.readyPressed(sUser,nCheck);
    end

    and then finally in readycheck I added the real "readyPressed(sUser,nCheck);

    By the time I got to "main" I had figured out it was

    window.parentcontrol.window.parentcontrol.window.r eadyPressed(sName,1);

    It was kinda klunky but I eventually figured out the path. That whole backwards thing was confusing but I think next time I'll have a much better idea how to do it. Thanks all for the tips!
    Last edited by celestian; February 28th, 2018 at 15:58.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #12

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Thanks for sharing, Celestian. You da man!

  3. #13
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29
    Have you figured this out yet?
    Oops nevermind
    Last edited by Minty23185Fresh; February 28th, 2018 at 22:53.
    Current Projects:
    Always...
    Community Contributions:
    Extensions: Bardic Inspiration, Druid Wild Shapes, Local Dice Tower, Library Field Filters
    Tutorial Blog Series: "A Neophyte Tackles (coding) the FG Extension".

  4. #14
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Quote Originally Posted by Minty23185Fresh View Post
    Have you figured this out yet?
    I've gone four or five times up successfully, just as you did in post 7.
    It looks to me like you went in circles. window goes up, subwindow goes down.

    I think you have to use the names?
    Like window.main_user.window.main.window

    Maybe it's the ready checks instead...
    Yep - it has been figured out. What I mentioned in post #9 was the solution.

    You can't use control/windowclass actual names to go up from the bottom of a GUI hierarchy - you have to use referential names such as window and parentcontrol - because "window" doesn't return the top most window, it returns the current window the control code is in.
    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!

  5. #15
    Quote Originally Posted by Minty23185Fresh View Post
    Have you figured this out yet?
    Oops nevermind
    Replace "subwindow" with "parentcontrol" and it works out going backwards. Using subwindow takes you back down.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

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
  •  
FG Spreadshirt Swag

Log in

Log in