Is there an event that runs on GUIOn (like before fadein with room screens)?
If not - can it be implemented?
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.
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.).
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);
Try the
if (IsGUIOn(7)==1) { your code here }
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.
Global ints. Check for a global int to do different things to the gui before its called.
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);