DICE PACKS BUNDLE
  1. #1

    windowinstance and self closing causing "crash"

    I am experimenting with "hypertext" links. The idea is that you use a template that will display a list of text (names of records) and then highlight the ones you're moused over. If you click on said record it will open the window associated with it. This part works.

    I've configured the window in my test to "close()" if the onHover(bControl) bControl = false. This works, twice... on the third time when moving the mouse off of the opened window FGC crashes. In FGU I get the following error on the first time I do move the mouse off the record window.

    Code:
    [12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit'
    [12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'datasource' | { #1 = s'.abilitynoteslist' }
    [12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'activatewindow' | { #1 = s'quicknote_hover' }
    [12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'node' | databasenode = { combattracker.list.id-00004 }
    [12/14/2020 4:42:46 PM] [ERROR]  MOUSE UPDATE: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
      at System.Collections.Generic.HashSet`1+Enumerator[T].MoveNext () [0x00013] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
      at LEECPKFJIAJ.LMMHCENIOJI () [0x000cb] in <47f8d6a0706643a08ed500e0bc60c519>:0 
      at LEECPKFJIAJ.CLGFEEHEDAB () [0x00046] in <47f8d6a0706643a08ed500e0bc60c519>:0 
      at FG.FGDesktop.OPILCLOHJGM () [0x0002f] in <47f8d6a0706643a08ed500e0bc60c519>:0 
      at FG.FGDesktop.Update () [0x0004e] in <47f8d6a0706643a08ed500e0bc60c519>:0
    The actual code from the script section in the opened record window:
    Code:
          function onHover(oncontrol)
            if not oncontrol then
              close();
            end
          end
    How can I correct this problem?
    ---
    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. #2
    Don't close in onHover events. I can look, but it depends on the chaining. Even in FGC, there were certain events that you couldn't close/destroy on.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    Don't close in onHover events. I can look, but it depends on the chaining. Even in FGC, there were certain events that you couldn't close/destroy on.

    Regards,
    JPG
    How would you recommend closing the window if it looses focus (mouse moves off the window) ?
    ---
    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.

  4. #4
    That's not really something that's supported right now. The hover system would need to be rewritten completely to account for objects disappearing in the middle. One of the problems is that hovering is a "stack of objects", since hover events are applied to multiple objects at once.

    Regards,
    JPG

  5. #5
    Hum, shame. W/o some kludgy hackery I wouldn't be able to get around that. Would really be nice to have the ability to close a window when it's no longer needed by moving the mouse away from it. Very useful for quick popup windows.
    ---
    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.

  6. #6
    That's basically what a tooltip is; so you could possibly use that if it's just simple text to show.

    JPG

  7. #7
    Quote Originally Posted by Moon Wizard View Post
    That's basically what a tooltip is; so you could possibly use that if it's just simple text to show.

    JPG
    I do use those when I can but my idea was to allow drag/drop from a quick popup or similar.... or formattext text.
    ---
    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
  •  
STAR TREK 2d20

Log in

Log in