Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: on Sun 26/10/2003 11:09:16

Title: How to check if dialog is running?
Post by: on Sun 26/10/2003 11:09:16
Is it possible to check wether a dialog is running?
I want to script something like this:
If (the dialog is running and the dialogGUI==off)
        dialogGUI==on


So that when you're in a dialog and click on an option, the dialogGUI doesn't go away, only the options, so you are left with a nice blackness on the bottom of the screen (just like in MI1 & 2  :)).
Title: Re:How to check if dialog is running?
Post by: Pumaman on Sun 26/10/2003 17:27:41
The easiest way to do this would be to switch the GUI on before you call RunDialog, then switch it off in repeatedly_execute (since repeatedly_execute does not run while a dialog is in progress).
Title: Re:How to check if dialog is running?
Post by: on Sun 26/10/2003 17:38:48
But how would I go about switching on the GUI before I call RunDialog? Is there any perticular place in the global script I can place this?
Title: Re:How to check if dialog is running?
Post by: Pumaman on Sun 26/10/2003 17:41:12
The easiest way is probably to define your own custom function:


function MyRunDialog(int topic) {
 GUIOn(XX);
 RunDialog(topic);
}


and then use it rather than RunDialog in your scripts.
Title: Re:How to check if dialog is running?
Post by: on Sun 26/10/2003 17:43:33
Thanx Pumaman! You saved me  :)