Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Gui Timeout (https://forums.graalonline.com/forums/showthread.php?t=67460)

Angel_Light 07-20-2006 03:29 AM

Gui Timeout
 
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 10:37 AM

The code looks ok, text1 must be bugged / not set.

ForgottenLegacy 07-20-2006 12:55 PM

Maybe use object.setText(text), and check to see the timeout is working.

Angel_Light 07-21-2006 04:31 AM

The timeout is working becuase it's updating other stats but the player.mp wont update :/

Omini 07-21-2006 01:52 PM

Put all the gui script in one part, but have the timeout somewhere else.

Example

PHP Code:

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

function 
LoadGui()
  {
  new 
GuiWindowCtrl("Gui_Window") {
    
destroyonhide false;
    
profile "GuiRedTransWindowProfile";
    
profile.transparency .5;
    
width 70;
    
height 60;
    
10;
    
10;
    
active true;
    
visible true;
    
canresize false;
    
canmaximize false;
    
canminimize false;
    
canmove false;
    
text "GUI";
    
    new 
GuiTextCtrl("GuiText") {
      
10;
      
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 05:05 AM

still doesnt work :/ it updates when I update the weapon but thats it

EDIT: I got it to work thanks everyone


All times are GMT +2. The time now is 10:59 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.