-
January 19th, 2024, 11:15 #1
Progress information - slow function
I've a slow function. This function creates a large amount of data for my system during character creation.
I would like to show something to the user. I had thought of a field with a description of the progress (textual),
but it only updates at the end, so it's not needed.
Do you have suggestions?
-
January 19th, 2024, 11:38 #2
Is your code running in an onInit function? If so, this function is generally called before windows (and contained) controls are displayed, for example: https://fantasygroundsunity.atlassia...nstance#onInit
So, if you want to display something to the user during an onInit function, then you may want to display another window showing progress, or perform the code outside of an onInit function.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!
-
January 19th, 2024, 11:52 #3
No, it is not always called during onInit. What I assume is that when the process starts, no updates come to the presentation,
so the effects are only seen at the end. I believe that even if I opened a window, perhaps to be removed at the end, all the
effects would be made visible at the end (i.e. I believe that the window would not be seen at all).
What I would need is a command that "show output now", i.e. redraws it without waiting for the current process to finish.
-
January 19th, 2024, 14:31 #4
I think we'll need a comment from one of the FG devs on this.
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!
-
January 20th, 2024, 18:07 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
Due to the fact that the Lua scripts can modify anything in the UI or database and need to be processed sequentially with network and other updates, the Lua runs in a single threaded manner with the UI/database. So, there will be no screen updates nor user inputs during a long-running process.
In general, I highly recommend rethinking/redesigning any processes which run so long that you would need to do this.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks