Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: am on Mon 16/06/2003 20:17:07

Title: Question/Suggestion - GUIOn event
Post by: am on Mon 16/06/2003 20:17:07
Is there an event that runs on GUIOn (like before fadein with room screens)?
If not - can it be implemented?
Title: Re:Question/Suggestion - GUIOn event
Post by: Scummbuddy on Mon 16/06/2003 20:24:21
Are you asking for this?
The room interactions window that allows you to place actions that could go in 'before fade in' or 'after fade in'
Or this?
that you can do GuiOn();   GuiOff();

cause thats all available.
Title: Re:Question/Suggestion - GUIOn event
Post by: am on Mon 16/06/2003 20:45:23
No, what I would like to have is an event, similar to the "before fade in", only for GUI's, e.g. when I call the function GUIOn(7), there is an event that gets called and aranges things in the GUI (add items to listbox, etc.).
Title: Re:Question/Suggestion - GUIOn event
Post by: Archangel (aka SoupDragon) on Mon 16/06/2003 21:21:51
You could probably do that in your script; for example

//in the code for whatever you want to trigger the gui

//set up your gui how you want it, then just
GuiOn(x);
Title: Re:Question/Suggestion - GUIOn event
Post by: Spyros on Mon 16/06/2003 21:24:59
Try the
if (IsGUIOn(7)==1) { your code here }
Title: Re:Question/Suggestion - GUIOn event
Post by: am on Mon 16/06/2003 21:53:38
The problem is that the GUI is called from several places, and I don't want to repeat the code everywhere, also I need it to be done before the GUI is shown, so the if(IsGUIOn) won't help either.
What I currently do is I use a global function for averything that should be done, and I call it before loading the GUI, but I think an event will be a neeter solution.
Title: Re:Question/Suggestion - GUIOn event
Post by: Scummbuddy on Mon 16/06/2003 22:08:11
Global ints.  Check for a global int to do different things to the gui before its called.
Title: Re:Question/Suggestion - GUIOn event
Post by: Pumaman on Mon 16/06/2003 22:15:35
Create your own function in the global script, something like:


function JibbleGUIOn () {
 // setup the listboxes here
 GUIOn(7);
}

then in your normal scripts, just use

JibbleGUIOn();

instead of GUIOn(7);