Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   useOwnProfile taking over default? (https://forums.graalonline.com/forums/showthread.php?t=134266856)

devilsknite1 07-26-2012 07:34 AM

useOwnProfile taking over default?
 
When changing a GuiContextMenuCtrl textprofile's font size, color, and style via useownprofile, when right clicking on the accounts in the in-game playerlist and viewing player profiles, those attributes carry over. How do I limit this to only the GuiContextMenuCtrl I've created? Here's a snippet of what I've done; maybe I'm just doing it incorrectly?

PHP Code:

new GuiContextMenuCtrl"Guild_Menu" ) {
    
useOwnProfile true;
    
profile GuiBluePopUpMenuProfile;
    
textprofile GuiBlueTextListProfile;
    
textprofile.fontSize 15;
    
textprofile.fontColor "orange";
    
textprofile.fontStyle "bold"

I understand I'm modifying the GuiBlueTextListProfile, but that's only because (obviously) I need the qualities from it. I only want that useownprofile to effect that GuiContextMenuCtrl. Any ideas?

Emera 07-26-2012 11:49 AM

I always put useownprofile = true; under the profile you're working with, and that always works for me.

PHP Code:

new GuiWindowCtrl("Window") {
  
profile GuiBlueWindowProfile;
  
useownprofile true;



Crow 07-26-2012 11:54 AM

Emera, I was thinking that the order might have been a problem as well. I believe, however, that the problem lies within the fact that GuiContextMenuCtrl objects (can) use two different profiles. I don't think useOwnProfile applies to the textprofile at all. I guess you might be better off creating your own profile for this purpose, maybe inheriting the one you wanted to use originally. Profile inheritance should be possible somehow, I just can't remember how to do it, sorry.

xXziroXx 07-26-2012 11:57 AM

Quote:

Originally Posted by Crow (Post 1700158)
Emera, I was thinking that the order might have been a problem as well. I believe, however, that the problem lies within the fact that GuiContextMenuCtrl objects (can) use two different profiles. I don't think useOwnProfile applies to the textprofile at all. I guess you might be better off creating your own profile for this purpose, maybe inheriting the one you wanted to use originally. Profile inheritance should be possible somehow, I just can't remember how to do it, sorry.

Pretty sure you can do...

textprofile.profile = "nameofprofile";
textprofile.useOwnProfile = true;

Emera 07-26-2012 12:12 PM

Quote:

Originally Posted by xXziroXx (Post 1700159)
Pretty sure you can do...

textprofile.profile = "nameofprofile";
textprofile.useOwnProfile = true;

I never knew you could use useownprofile for specific profiles like that. That's neato.

Crow 07-26-2012 12:24 PM

Quote:

Originally Posted by xXziroXx (Post 1700159)
Pretty sure you can do...

textprofile.profile = "nameofprofile";
textprofile.useOwnProfile = true;

As far as I know, useOwnProfile is not a GuiControlProfile variable. So that probably won't work. Worth a shot though.

cbk1994 07-26-2012 02:54 PM

OP's problem with useOwnProfile taking over the defaults is indeed caused by the ordering of useOwnProfile.

Quote:

Originally Posted by Crow (Post 1700158)
I don't think useOwnProfile applies to the textprofile at all. I guess you might be better off creating your own profile for this purpose, maybe inheriting the one you wanted to use originally. Profile inheritance should be possible somehow, I just can't remember how to do it, sorry.

You could probably do something like... (edit: tested, this does work)

PHP Code:

textprofile = new GuiBlueTextListProfile();
textprofile.fontColor = {25500}; 

or just make your own profile the normal way (you can do new GuiBlueTextListProfile("MyProfile") instead of new GuiControlProfile("MyProfile") for inheritence).

Quote:

Originally Posted by xXziroXx (Post 1700159)
Pretty sure you can do...

textprofile.profile = "nameofprofile";
textprofile.useOwnProfile = true;

Please don't put profile names in quotes. They're objects, not strings. useOwnProfile is a property of a GUI control, not of a profile (that wouldn't make sense since profiles are shared, hence why unique ones are necessary to make changes for a certain object).

textprofile and scrollprofile are the profile objects the control is using.

PHP Code:

profile GuiBlueContextMenuProfile;
textprofile GuiBlueTextListProfile;
scrollprofile GuiBlueScrollProfile

Quote:

Originally Posted by Emera (Post 1700160)
I never knew you could use useownprofile for specific profiles like that.

You can't.

devilsknite1 07-26-2012 09:14 PM

Quote:

Originally Posted by cbk1994 (Post 1700168)
You could probably do something like... (edit: tested, this does work)

PHP Code:

textprofile = new GuiBlueTextListProfile();
textprofile.fontColor = {25500}; 


Worked great, thanks. :)


All times are GMT +2. The time now is 07:20 PM.

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