Thread: Modal popups?
-
September 9th, 2019, 05:18 #1
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?
-
September 9th, 2019, 14:07 #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.
-
September 10th, 2019, 04:16 #3
Archangel
- 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....
-
September 10th, 2019, 05:07 #4
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!
-
September 10th, 2019, 05:13 #5
Archangel
- 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.
-
September 10th, 2019, 07:03 #6
-
September 10th, 2019, 07:06 #7
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