PDA

View Full Version : Gui Timeout


Angel_Light
07-20-2006, 04:29 AM
Hi all

I created a gui back some time and it worked great now a few monthys later all's going fine but the player mp wont update in a guitextctrl(text1) I have text = player.mpand in a timeout I have

if (player.mp != text1.text) {
text1.text = player.mp;
}

yet this doesnt work. Does anyone not know why?

Admins
07-20-2006, 11:37 AM
The code looks ok, text1 must be bugged / not set.

ForgottenLegacy
07-20-2006, 01:55 PM
Maybe use object.setText(text), and check to see the timeout is working.

Angel_Light
07-21-2006, 05:31 AM
The timeout is working becuase it's updating other stats but the player.mp wont update :/

Omini
07-21-2006, 02:52 PM
Put all the gui script in one part, but have the timeout somewhere else.

Example

function onCreated()
{
LoadGui();
onTimeout();
}

function LoadGui()
{
new GuiWindowCtrl("Gui_Window") {
destroyonhide = false;
profile = "GuiRedTransWindowProfile";
profile.transparency = .5;
width = 70;
height = 60;
x = 10;
y = 10;
active = true;
visible = true;
canresize = false;
canmaximize = false;
canminimize = false;
canmove = false;
text = "GUI";

new GuiTextCtrl("GuiText") {
x = 10;
y = 23;
width = 124;
height = 20;
useownprofile = true;
profile.fontcolor = {1,1,1};
}
}
}

function onTimeout()
{
GuiText.setText("MP: "@player.mp);
setTimer(0.1);
}

Angel_Light
07-22-2006, 06:05 AM
still doesnt work :/ it updates when I update the weapon but thats it

EDIT: I got it to work thanks everyone