GUI not turning off when expected [SOLVED]

Started by Etcher Squared Games, Sun 04/06/2006 01:39:32

Previous topic - Next topic

Etcher Squared Games

I've gotten some ideas searching through the help and the forums as to what is going on, but I can't get this to work.

Here is what I'm doing.Ã,  I set a timer and when the timer goes off, which I check in repeat_execute (not the always version) then I run another function.Ã,  The first thing it does is turn off the GUI that may be showing then do other stuff.

But, the GUI is NOT turning off.Ã,  My guess from reading other threads is that it has to do with Gui.visible = false is one of those things that don't take affect until after the current script is done running...


here's my RE
Code: ags

#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
Ã,  // put anything you want to happen every game cycle here

Ã,  if (!time_test)
Ã,  Ã,  return;

Ã,  time_tick++;
Ã,  if (time_tick > time_max) 
Ã,  Ã,  ActionPerformed(atFail, "", null, -1, null, null);
Ã,  Ã,  
}



Here's the direct function in question
Code: ags

function ActionPerformed(ScriptActionType action, String dialog, Region* regionWalked, int actionDone, Character* invOnChar, InventoryItem* invItem)
{
Ã,  gMyinv.Visible = false;
Ã,  bool itemPassed = (DidItemPass(action, dialog, regionWalked, actionDone, invOnChar, invItem) == 0);

Ã,  if (itemPassed)
Ã,  {
Ã,  Ã,  RunItem();
Ã,  }
Ã,  else 
Ã,  {
Ã,  Ã,  Display(Script[_line].directorYell);
Ã,  Ã,  RestartGame();
Ã,  }
}


So, how do I get the GUI to hide when I want it to?

thank you
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

Gilbert

Is the GUI a popup modal? In that case the game's paused when the GUI is visible, so repeatedly_execute() won't be run.
If that's teh case, either move the code to _always, or change the GUI's mode to "always".

SSH

Doing a Wait(1); after the Visible command will make the screen update if Gilbot's suggestion doesn't help
12

Etcher Squared Games

The wait(1) is all I needed.

Sorry about the delayed reply.  I knew the function was getting called because I put a display before and after.....

thank you
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

SMF spam blocked by CleanTalk