DICE PACKS BUNDLE

Thread: Modal popups?

  1. #1
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075

    Modal popups?

    I saw some of my code duplicated, what I thought was sloppy until after I moved it I saw odd behavior.

    I realized it was because I had the same cleanup code duplicated at the end the "handler" method for attemptToMultiClass and attemptToDualClass methods instead of where I would logically put it after it checks if first class, multi or dual then falls through to the cleanup.

    This does not work because I call "Interface.openwindow()" to present the user with a "are you sure" option (but it may be more than that in future, so don't assume a yes/no is sufficient for the popup) and the code falls through to the cleanup before the new window is closed and therefore the settings made in the window haven't yet been made.

    I got around this by making sure I did nothing after the openWindow calls and handled all "post window" code in the window handlers. No problems. Just wondered if I missed a way to call a window "modally" where it interrupts all until you clicked a choice and returns to caller?

  2. #2
    The only thing im aware of that is remotely like that is this.

    https://www.fantasygrounds.com/refdo...#dialogMessage

    I've tried it but decided against it because it's pretty crude.
    ---
    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.

  3. #3

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    And it jars you right out of the suspension of disbelief with a very harsh and sparse windowy dialog box. It blows super big chunks. Not that I have any feelings about the subject....

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    And then if the user doesn't click it for a while their instance of FG lags way behind in processing messages/code etc. and you're a bit screwed.
    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. #5

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Just happy bitching, Trenloe.

    Without multi-threading, a modal window is, as you point out, a real problem.

  6. #6
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    Quote Originally Posted by celestian View Post
    The only thing im aware of that is remotely like that is this.

    https://www.fantasygrounds.com/refdo...#dialogMessage

    I've tried it but decided against it because it's pretty crude.

    Yeah, that yes/no/cancel option was only one I saw.

    Like said, I made due by copying the 4 calls I needed at end to each of the 3 possible paths since 2 of them required input from the user. Works fine enough, just wanted to make sure I didn’t miss another paradigm.

  7. #7
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    Quote Originally Posted by Trenloe View Post
    And then if the user doesn't click it for a while their instance of FG lags way behind in processing messages/code etc. and you're a bit screwed.
    Yeah, in my worlds, the method that calls this pop up would be suspended until the pop up returned but due to the magic of threading and synchronization background processing and message handling could go on.

    But I get what you mean, it’s one reason I moved the code into the window handler instead.

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 Product Walkthrough Playlist

Log in

Log in