Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUI Profile Help (https://forums.graalonline.com/forums/showthread.php?t=134259988)

Mark Sir Link 07-29-2010 05:31 AM

GUI Profile Help
 
In a class NPC, I am defining a few GUIProfiles. However, SweetTabProfile and SweetScrollProfile fail to load (the rest load fine).

However, if I update a weapon that is joining the class, SweetTabProfile and SweetScrollProfile will then start to load properly.

Any idea what's up?


PHP Code:

Profile Class

//#CLIENTSIDE
function onCreated(){
  new 
GuiWindowProfile("SweetWindowProfile")
    {
    
bitmap "Kevin641800-gamerkid_black_gui_window.png";
    
fontcolor = {255,255,255,255};
  }
  new 
GuiTabProfile("SweetTabProfile"){
    
bitmap "unevent_achievements_gui_tab.png";
    
fontcolor = {255,255,255,255};
  }
  new 
GuiButtonProfile("SweetButtonProfile")
    {
    
bitmap "unevent_gamerkid_gui_btn_black.png";
    
fontcolor = {255,255,255,255};
  }
  new 
GuiTextListProfile("SweetTextListProfile"){
    
fontcolor = {255,255,255,255};
    
fillcolorhl = {175,175,175,255};
  }
  new 
GuiTextProfile("SweetTextProfile")
    {
    
fontcolor = {255,255,255,255};
  }
  new 
GuiScrollProfile("SweetScrollProfile")
    {
    
bitmap "unevent_achievements_gui_scroll.png";
  }
  new 
GuiTextEditProfile("SweetTextEditProfile")
    {
    
bitmap "unevent_gamerkid_gui_txtedit_black.png";
    
fontcolor = {255,255,255,255};
    
fillcolor = {27,27,27,255};
    
fillcolorhl = {150,150,150,255};
  }
  new 
GuiRadioProfile("SweetRadioProfile")
    {
    
bitmap "unevent_gamerkid_gui_radio_black.png";
    
fontcolorsel  = {255,255,255,255};
    
fontcolor = {225,225,225,255};
  }



Mark Sir Link 07-29-2010 05:47 AM

resolved by putting the profiles into a weapon instead.

cbk1994 07-29-2010 01:23 PM

FYI the problem was likely that the GUI was being drawn before the profiles were loaded. You can always do something like:

PHP Code:

while (! profilesLoaded) {
  
sleep(0.05);


in weapons that draw profiles at the start (this forces it to wait for the profiles to load). Then when making the profiles, add this to the end of the function:

PHP Code:

profilesLoaded true

Otherwise, another option to make sure that the profiles are always made first is to put the GuiControlProfile-creating weapon as the first weapon in 'weaponorder' in server options.


All times are GMT +2. The time now is 09:44 AM.

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