/common/gui, wich always worked fine. When I do this with versi"> Gui profiles: where to put them? | Torque Game Builder | Forums | Community | GarageGames.com

Game Development Community

Gui profiles: where to put them?

by Koen Van Baelen · in Torque Game Builder · 10/05/2007 (1:51 pm) · 6 replies

Seems like the developers of TGB have never heard of this little thing called "backwards compatibility". In the previous version, I put gui control profiles in "profiles.cs", located in /common/gui, wich always worked fine. When I do this with version 1.5.1, however, it doesn't. The profile doesn't even show up in the list in the gui builder. Here's the code for my profile:

new GuiControlProfile (GuiTextGreen : GuiTextProfile)
{
fontSize = 24;
fontColor = "0 255 0";
};

This worked perfectly in a previous project, but in this version of TGB it apparently doesn't and of course nothing about it can be found in the documentation. So, where do I have to put the profile to make it work?

#1
10/05/2007 (2:12 pm)
In game/gamescripts/datablocks.cs, add the following line of code :
exec("common/gui/profile.cs");
It should work.
#2
10/06/2007 (2:40 am)
Okay, it works now. Thanks for the help!
#3
10/09/2007 (11:41 pm)
Thanks Benjamin. I was just trying to figure this problem out tonight and here I find a recent answer.

Just to avoid confusion for anyone who finds this later, I needed to add an 's' to the end of profile.

exec("common/gui/profiles.cs");

Once I got that set up, I think I still needed to shutdown and restart TGB before the change took effect.
#4
02/02/2008 (3:24 pm)
My thanks also to Benjamin and Steven. This thread saved me a lot of hair-pulling just now. (Exec it from datablocks.cs ... that makes sense. *eyeroll*)

I also found that you can exec your other gui files in the same place and they'll always show up in the GUI dropdown without you having to go open the files manually. Minor convenience. (1.5)
#5
02/03/2008 (6:25 am)
Actually this seemed to have changed. Your gui profiles should be placed into game/gameScripts/guiProfiles.cs. This gets exec'ed by default and will also be available when in the gui builder. Doing it the way you stated will not make them available in the gui builder.
#6
02/04/2008 (9:01 am)
Here is the information related to the guiProfiles.cs file
Quote:
GUI Profiles are now deployed with the game template
There is a new guiProfiles.cs script file
All game gui profiles should now go in this file
GUI Editor will now look for and load these profiles


GUI Editor
All GUI's located in the game projects \game\gui\ folder will automatically be loaded
The editor will now only show GUI's that belong to the game in the drop down menu
If you are a source code owner and the tools are compiled with DEBUG, the editor GUI's will also be listed
The editor will now only show GUI Profiles that belong to the game
Must have a guiProfiles.cs script file in the game project directory
When saving a new GUI, the editor will now properly add the .gui extension
When saving a new GUI, the editor will now remember the file name when re-saving
It is now possible to select locked gui items, but still impossible to move or resize them
It is now possible to turn off 'IsContainer'

The entire changelist can be found here

http://garagegames.com/products/torque/tgb/features/160changelist/