[CoD2] create functions in .menu-files!
Sanibonani =)
I just discovered that you are able to define simple functions in CoD2-menus!
PHP Code:
#include "ui_mp/menudef.h"
#define TEXT_DRAW( t_rect , t_text ) \
itemDef \
{ \
rect t_rect \
text t_text \
visible 1 \
}
{
menuDef
{
name "testmenu"
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
blurWorld 5.0
TEXT_DRAW( 0 0 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER , "Text on the center of your screen!" )
}
}
- you have to add after every line of your function a "\", except for the last closing bracket!
- just call the function as in the example without a semicolon! >>> FUNCTION( parameter )
- I guess your FUNCTION-pointer needs to be defined and called in UPPERCASE!
feel free to find other possible ones and please post them here!
cheers serthy