Timer for dialog.Show()
Case number: | 845813-2003914 |
Topic: | Game: Tools |
Opened by: | Bruno Kestemont |
Status: | Open |
Type: | Suggestion |
Opened on: | Wednesday, July 5, 2017 - 14:04 |
Last modified: | Wednesday, July 5, 2017 - 14:04 |
I'd like to be able to propose dialog for several seconds only, but if the user does'nt click on the "ok" button, it goes on.
This would add an argument to the dialog.Show() function as follows:
integer dialog.Show(table dialogTable, [integer delay])
By default, the delay is infinite or very big: the recipe stays waiting for an user action.
If an [integer delay] is give, the dialog stays open for the given time, then closes with default value 1 if there was no entry from the user during this delay.
For example, the following will pop up a "Happy Folding !" window during 2 seconds.
function PopUpDialog()
ask = dialog.CreateDialog()
ask.l = dialog.AddLabel("Happy Folding !")
askresult=dialog.Show(ask, 2)
end
Examples of uses:
- To display warnings or pop ups without interrupting a script
- On an option dialog, if the users doesn't change the options neither click "ok" after some times, the recipe might go on
(sometimes, you don't notice there is a dialog. One night after, you discover that nothing appended).