Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-25-2009, 06:32 PM
Sage_Shadowbane Sage_Shadowbane is offline
Graal Developer
Sage_Shadowbane's Avatar
Join Date: Mar 2004
Posts: 585
Sage_Shadowbane will become famous soon enough
Help pls?

So i've never used GuiCtrls before, i've always just coded my guis by hand using custom images. But i'm actually trying them out, and oddly I can't seem to figure out why my gui images wont work. If someone could help, I would appreciate it.

So first I have a class set up named gladeious_guiprofiles, and within that is the code:
HTML Code:
//#CLIENTSIDE
function GetProfiles()
{
  new GuiWindowProfile("Gladeious_Window")
  {
    profile.bitmap = "gladeius_gui_window.png";
  }
  new GuiScrollProfile("Gladeious_Scroll")
  {
    profile.bitmap = "gladeius_gui_scroll.png";
  }
  new GuiTextListProfile("Gladeious_TextList")
  {
    profile.bitmap = "";
    profile.fillcolor ={0, 0, 0, 0};
    profile.fillcolorhl ={0, 0, 0, 0};
    profile.fillcolorna ={0, 0, 0, 0};
    profile.fontcolor ={255, 255, 255, 255};
    profile.fontcolorhl ={225, 225, 225, 255};
    profile.fontcolorna ={255, 255, 255, 255};
    profile.fontcolorsel ={235, 235, 235, 255};
    profile.align = "center";
    profile.fonttype = "Comic Sans MS";
    profile.fontsize = 20;
    profile.fontstyle = "cbi";
    profile.textshadow = true;
  }
  new GuiButtonProfile("Gladeious_Button")
  {
    profile.bitmap = "gladeius_gui_button.png";
    profile.align = "center";
    profile.fonttype = "Comic Sans MS";
    profile.fontcolor ={255, 255, 255, 255};
    profile.fontcolorhl ={225, 225, 225, 255};
    profile.fontstyle = "bc";
    profile.fontsize = 20;
    profile.textshadow = true;
  }
}
Than, I have the weapon which is creating the GUI's, and is joining to the class and trying to retrieve the GetProfile() function, but oddly in the F2 output console under Script it says "GraalScript: Function GetProfiles not found in script of Weapon Sage/Testing".

But here is the weapon code:

HTML Code:
//#CLIENTSIDE
function onCreated()
{
  this.join("gladeious_guiprofiles");
  GetProfiles();  
  new GuiWindowCtrl("Example_Window_1")
  {
    profile = "Gladeious_Window";
    
    width = 200;
    height = 100;
    x = screenwidth/2-this.width/2;
    y = screenheight/2-this.height/2-100;
    text = "";
    canminimize=canmaximize=canresize=canmove=canclose=false;
    alpha = .75;
    
    new GuiScrollCtrl("Example_Scroll_1")
    {
      profile = "Gladeious_Scroll";
      
      x = 16;
      y = 16;
      width = 168;
      height = 68;
      hScrollBar = "alwaysOff";
      vScrollBar = "alwaysOn";
      
      new GuiTextListCtrl("Example_List_1")
      {
        profile = "Gladeious_List";
        
        x = y = 0;
        width = 140;
        fitparentwidth = true;
        
        clearrows();
        addrow(0, "Test");
        addrow(1, "Test 2");
      }
    }
  }
  new GuiWindowCtrl("Example_Window_2")
  {
    profile = "Gladeious_Window";
    
    width = 250;
    height = 150;
    x = screenwidth/2-this.width/2;
    y = Example_Window_1.y+Example_Window_1.height-8;
    text = "";
    canminimize=canmaximize=canresize=canmove=canclose=false;
    alpha = .75;
  }
  new GuiButtonCtrl("Example_Button_1")
  {
    profile = "Gladeious_Button";
    
    width = 88;
    height = 46;
    x = screenwidth/2-this.width/2+54;
    y = Example_Window_2.y+Example_Window_2.height+8;
    text = "Cancel";
    alpha = .75;
  }
  new GuiButtonCtrl("Example_Button_2")
  {
    profile = "Gladeious_Button";
    
    width = 88;
    height = 46;
    x = screenwidth/2-this.width/2-54;
    y = Example_Window_2.y+Example_Window_2.height+8;
    text = "Learn";
    alpha = .75;
  }
}
Edit: Where are my manners.. z.z MERRY CHRISTMAS EVERYONE!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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