Once we have gathered our graphic files into the correct locations and told the program what menu script files we wish to load it is time to create those same menu script files. A script file is a text file containing information in a special format that the program can use to create a menu. While more than one menu can be defined in a script file it is more sensible to have only one menu definition per script file, simply for debugging purposes. Use your favorite text editor (such as NotePad) to create and edit the script files.
In the Team Arena ui directory there is a file called menudef.h. This contains a series of #define statements that assign values to labels. You can use these labels in place of the numeric values to make your script more readable. For example :
style WINDOW_STYLE_SHADER
is far more understandable than
style 3
To make these defines avalible to the menu script you place the following line at the start of your script file.
#include "ui/menudef.h"
A menu is defined by everything that is placed between curly braces ( "{" and "}" ). Anything outside of the curly braces is not part of the menu definition. At this point what we have is a file containing this :
#include "ui/menudef.h"
{
}
In a menu definition there can be two parts, an optional Global Asset Definition and the Menu Definition. The Global Asset Definition part is used to load those assets and set those values that will be used by every menu. It needs to be defined only once, in any menu script that is loaded by the program and is usually defined in the main menu. The Menu Definition part is used to define the actual menu
#include "ui/menudef.h"
{
assetGlobalDef
{
}
menuDef
{
}
}