CONST INT MAX_LANG			= 10;
CONST INT MAX_ITEMS			= 20;
CONST INT MAX_EVENTS			= 10;
CONST INT MAX_SEL_ACTIONS		= 5;
CONST INT MAX_USERVARS			= 2;


CONST INT SEL_ACTION_UNDEF		= 0;
CONST INT SEL_ACTION_BACK		= 1;
CONST INT SEL_ACTION_STARTMENU		= 2;
CONST INT SEL_ACTION_STARTITEM		= 3;
CONST INT SEL_ACTION_CLOSE		= 4;
CONST INT SEL_ACTION_CONCOMMANDS	= 5;			// -> console commands
CONST INT SEL_ACTION_PLAY_SOUND		= 6;
CONST INT SEL_ACTION_PLAY_PFX		= 7;
CONST INT SEL_ACTION_EXECCOMMANDS	= 8;			// -> dynamic build in func.


CONST INT MENU_ITEM_UNDEF			= 0;
CONST INT MENU_ITEM_TEXT			= 1;
CONST INT MENU_ITEM_SLIDER			= 2;
CONST INT MENU_ITEM_INPUT			= 3;
CONST INT MENU_ITEM_CURSOR			= 4;
CONST INT MENU_ITEM_CHOICEBOX			= 5;
CONST INT MENU_ITEM_BUTTON			= 6;

CONST INT IT_CHROMAKEYED		= 1;
CONST INT IT_TRANSPARENT		= 2;
CONST INT IT_SELECTABLE			= 4;
CONST INT IT_MOVEABLE			= 8;
CONST INT IT_TXT_CENTER			= 16;
CONST INT IT_PFX_AUTO_SIZE		= 32;
CONST INT IT_DISABLED			= 64;


CONST INT MENU_OVERTOP			= 1;
CONST INT MENU_EXCLUSIVE		= 2;

CONST INT EVENT_UNDEF			= 0;
CONST INT EVENT_EXECUTE			= 1;
CONST INT EVENT_CHANGED			= 2;
CONST INT EVENT_LEAVE			= 3;
CONST INT EVENT_TIMER			= 4;
CONST INT EVENT_CLOSE			= 5;
CONST INT EVENT_INIT			= 6;
CONST INT EVENT_SEL_PREV		= 7;
CONST INT EVENT_SEL_NEXT		= 8;

CONST INT CLOSE_ITEM			= 1;

CLASS C_MENU_ITEM
{
	VAR	STRING fontName;
	VAR	STRING text[MAX_LANG];
	VAR	STRING backPic;
	VAR 	STRING alphaMode;
	VAR	INT    alpha;
	VAR	INT    type;
	VAR	INT    onSelAction[MAX_SEL_ACTIONS];
	VAR	STRING onSelAction_S[MAX_SEL_ACTIONS];
	VAR	STRING onChgSetOption;
	VAR	FUNC   onEventAction[MAX_EVENTS];
	VAR	INT    startPosX,startPosY;	// if flag IT_MOVEABLE is set.
	VAR	INT    posx,posy;
	VAR	INT    txtPosX,txtPosY;		// txt offset position in virtual coords relativ to this item	
	VAR 	INT    pfxPosX, pfxPosY;	// pfx offset position in virtual coords relativ to this item
	VAR	INT    dimx,dimy;		// -1 = AUTODETECT (FONTWISE)
	VAR	FLOAT  sizeStartScale;
	VAR	INT    flags;
	VAR     FLOAT  userFloat[MAX_USERVARS];
	VAR     STRING userString[MAX_USERVARS];

}; 

CLASS C_MENU {
	VAR 	STRING backPic;
	VAR 	STRING backWorld;
	VAR 	INT    posx,posy;
	VAR 	INT    dimx,dimy;	
	VAR     FLOAT  sizeStartScale;
	VAR 	INT    alpha;
	VAR	STRING musicTheme;
	VAR	INT    eventTimerMSec;
	VAR 	STRING items[MAX_ITEMS];
	VAR	INT    flags;
	VAR 	INT    startOption;
};

PROTOTYPE C_MENU_ITEM_DEF(C_MENU_ITEM)
{
	fontName 	= 	"menufont4.fon";
	text		=	"";
	backPic		= 	"MENU_SELECT_ITEM";
	alphaMode	=	"BLEND";
	alpha		=	254;			// NOTE: Must be under 255 to support chroma keying, chroma color is black
	type		=	MENU_ITEM_TEXT;
	startPosX	=	100;
	startPosY	=	100;
	posx		=	0;
	posy		=	0;
	txtPosX		=	0;
	txtPosY		=	0;			// obsolete if text is centered
	pfxPosX		= 	4096;
	pfxPosY		=	4096;			// optional pfx is centered
	dimx		=	-1;			// -1 = AUTODETECT
	dimy		=	-1;			// -1 = AUTODETECT
	flags		=	IT_CHROMAKEYED|IT_TRANSPARENT|IT_SELECTABLE|IT_PFX_AUTO_SIZE|IT_MOVEABLE;
	onSelAction[0]	= 	SEL_ACTION_BACK;
	//onSelAction[1]	=	SEL_ACTION_PLAY_PFX;
	//onSelAction_S[1]=	"MENU_SELECT_ITEM";
	onChgSetOption  =	"";
	sizeStartScale  = 	1;
	userFloat[0]    =	100;
	userFloat[1]	=	200;
	userString[0]	=	"slider_button.tga";
};

PROTOTYPE C_MENU_DEF(C_MENU)
{
	backWorld	=	"cutscenes\INTRO.zen";
	posx		=	0;
	posy		=	0;
	dimx		=	8191;
	dimy		= 	8191;
	sizeStartScale  = 	0.5;
	alpha		=	254;			// NOTE: Must be under 255 to support chroma keying, chroma color is black
	items[0]	=	"ITEM_BACK";
	flags		=	MENU_EXCLUSIVE;
	eventTimerMSec	=	1000;			// 1 second cycle with EVENT_TIMER
	musicTheme	=	"ow_dayStd";
	startOption	= 	1;
};


