Graal Forums

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

[email protected] 08-25-2009 09:21 PM

GuiProfile problems
 
So, I have a weapon added to the player on login. It controls all the profiles on Bomy Island.

HTML Code:

//#CLIENTSIDE
function onCreated() {
  this.onLoadProfiles();
}

function onLoadProfiles() {
  new GuiTextCtrl("BomyIsland_KingdomHeaderText") {
    with(profile) {
      fontcolor = {255, 255, 255, 255};
      fontsize = 24;
      fonttype = "Arial";
      shadowcolor = {25, 25, 25, 255};
      shadowoffset = {2, 2};
      textshadow = true;
    }
  }

  new GuiTextCtrl("BomyIsland_KingdomText") {
    with(profile) {
      fontcolor = {255, 255, 255, 255};
      fontsize = 14;
      fonttype = "Arial";
      shadowcolor = {25, 25, 25, 255};
      shadowoffset = {2, 2};
      textshadow = true;
    }
  }
}

So that pretty much works (I think...), however when I try to draw the chat it's coming up as not found and as though that profile doesn't exist and draws Graals default profile.

Here's the code I am using to draw it
HTML Code:

    new GuiMLTextCtrl("Kingdom_Text-Information") {
      profile = BomyIsland_KingdomHeaderText;
      position = {30, 20};
      extent = {100, 50};
       
      text = "Information";
    }

Any ideas? thank you. The text is being displayed after the profiles have been loaded so that's not the problem.
I made all the profiles in a weapon so that it's called only on login or updated, is this a bad idea...?

fowlplay4 08-25-2009 09:26 PM

I've always just used

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
loadProfiles();
}

function 
loadProfiles() {
  new 
GuiControlProfile(ATextProfile) {
    
textoffset "0 -10";
    
fontcolor "255 255 255";
    
fonttype "Arial";
    
fontsize 10;
    
fontstyle "b";
  }


Then in the GUI Object that I want to use it with

profile = ATextProfile;

I believe you can do things like:

PHP Code:

new GuiBlueTextProfile(Stuff) {
  
// automatically inherits variables from the GuiBlueTextProfile
  // adjust other variables at your discretion



[email protected] 08-26-2009 08:56 PM

Yeah- that's what I've done but it doesn't seem to work haha

Thank you

LoneAngelIbesu 08-27-2009 10:33 PM

Quote:

Originally Posted by [email protected] (Post 1518722)
Yeah- that's what I've done but it doesn't seem to work haha

Thank you

Notice:
Quote:

Originally Posted by fowlplay4 (Post 1518428)
new GuiControlProfile

Quote:

Originally Posted by [email protected] (Post 1518427)
new GuiTextCtrl("Bomy...

:cool:

[email protected] 08-27-2009 10:39 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1518971)
Notice:




:cool:

Yeah- I did that and it still didn't work. Thanks for the heads up though :)

LoneAngelIbesu 08-27-2009 10:47 PM

Quote:

Originally Posted by [email protected] (Post 1518976)
Yeah- I did that and it still didn't work. Thanks for the heads up though :)

This should work just fine. I don't know why you're in the profile scope, anyways.

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
this.onLoadProfiles();
}

function 
onLoadProfiles() {
  new 
GuiTextProfile("BomyIsland_KingdomHeaderText") {
    
fontcolor = {255255255255};
    
fontsize 24;
    
fonttype "Arial";
    
shadowcolor = {252525255};
    
shadowoffset = {22};
    
textshadow true;
  }

  new 
GuiTextProfile("BomyIsland_KingdomText") {
    
fontcolor = {255255255255};
    
fontsize 14;
    
fonttype "Arial";
    
shadowcolor = {252525255};
    
shadowoffset = {22};
    
textshadow true;
  }



[email protected] 08-28-2009 08:27 AM

I was modifying an old script- still not loading on login. Maybe it's the weapon order. Thanks again

cbk1994 08-28-2009 12:54 PM

Quote:

Originally Posted by [email protected] (Post 1519123)
I was modifying an old script- still not loading on login. Maybe it's the weapon order. Thanks again

weaponorder= should fix it, otherwise you can set some variable "profilesLoaded" and wait for it to be set before starting to draw the controls.

[email protected] 08-28-2009 09:13 PM

All fixed- haha. Thanks guys much appreciated :)


All times are GMT +2. The time now is 06:58 PM.

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