Status gui problem

Started by BorisZ, Sun 22/05/2005 15:58:26

Previous topic - Next topic

BorisZ

I made a status GUI to follow cursor once it is over a hotspot or object. And it's working perfectly, except it doesn't dissapear on time: for instance,  when I use move character blocking,  status GUI dissapears after moving is done and not before. I am not posting code here because it is standard GUI I got from tutorials somewhere in here.

RickJ

How / where are you turning the GUI off?

Ishmael

Add Wait(1); right after the GUI off command...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

BorisZ

#3
I am not turning GUI off. It is set to show hotspot/object name and if there is no hotspot, string is empty.

here is the code

string my_buffer;
GetLocationName(mouse.x, mouse.y, my_buffer);
SetLabelText(1, 0, my_buffer);

under repedeately execute, offcourse

Scorpiorus

You see, your status GUI is constantly updated each game loop in repeatedly_execute. But when a blocking command is underway the repeatedly_execute isn't invoked and thus the GUI isn't updated. Fortunately, a special repeatedly_execute_always function was introduced that's invoked each game loop, even when a blocking command is running. Just add that function into your global script and move all the GUI updating code in there:

function repeatedly_execute_always() {

   string my_buffer;
   GetLocationName(mouse.x, mouse.y, my_buffer);
   SetLabelText(1, 0, my_buffer);

}

SMF spam blocked by CleanTalk