#include "ui/menudef.h"

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	302
#define WINDOW_HEIGHT	378
#define GROUP_NAME		"grpTjmod_Hud"

// Window height = last_item_y + 12 + 24 (bottom button height) + 6
// Window width = SUBWINDOW_WIDTH + (padding*2)
// Paddding = 6 = general X position of subwindows

// Macros //

#include "ui/menumacros.h"
		
// tjmod hud Menu //
	
menuDef {
	name		"tjmod_hud"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	
	onESC {
		close tjmod_hud ; open tjmod ;
	}
	
	// Ingame attentionwhoring ftw! :p
	itemDef {
		name		"tjmod_logo"
		rect		545 0 64 64	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/tjmod_logo_ingame"
		forecolor	1 1 1 0.25
		visible		1
		decoration
	}
	
	itemDef {
		name		"tjmod_authors"
		rect		527 57 100 100	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/tjmod_authors_ingame"
		forecolor	1 1 1 0.25
		visible		1
		decoration
	}
	
// Window //

	WINDOW( "HUD", 90 )
	
// Buttons //
// Subwindows //

#define SUBWINDOW_WIDTH		290

// EDITFIELDLEFT = X Y W H TEXT SCALE TEXTY CVAR MAXCHAR MAXPAINTCHARS TOOPTIP
// NUMERICFIELD = X Y W H TEXT SCALE TEXTY CVAR MAXCHARS TOOLTIP
// BIND = X Y W H TEXT SCALE TEXTY CVAR TOOLTIP
// YESNO = X Y W H TEXT SCALE TEXTY CVAR TOOLTIP
// Subwindow height = LOWEST_ITEM_@_X - 14 (18-32=-14) 
// Subwindow -> items spacing = 6 + 12 = 18
// Subwindow spacing = e.g. 32+156+6 (first window starting, first window height, offset)

// Move //

	SUBWINDOW( 6, 32, (SUBWINDOW_WIDTH), 156, "CGaz Configuration" )
	
	// Preview cgazes, cba to make something like the crosshair thing =)
	itemDef {
		name		"cgaz_1"
		rect		12 60 64 32	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/cgaz_1"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	itemDef {
		name		"cgaz_2"
		rect		82 60 64 32	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/cgaz_2"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	itemDef {
		name		"cgaz_3"
		rect		152 60 64 32	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/cgaz_3"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	itemDef {
		name		"cgaz_4"
		rect		222 60 64 32	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/cgaz_4"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	
	LABELWHITE( 8, 48, 250, 8, "^zCGaz Huds are currently not 100%!", .1, ITEM_ALIGN_LEFT, 0, 8 )
	
	// Offset = 60 + 32 = 92,,, 92 + 6 = 98
	MULTI( 8, 98, (SUBWINDOW_WIDTH)-5, 10, "Draw CGaz:", .2, 8, "tj_drawcgaz", cvarFloatList { "Off" 0 "Type 1" 1 "Type 2" 2 "Type 3" 3 "Type 4" 4},  "Which cgaz to show, or NOT show it" )
	YESNO( 8, 110, (SUBWINDOW_WIDTH)-5, 10, "Cgaz Info:", .2, 8, "tj_cgazInfo", "Shows detailed CGaz info" )
	
	SLIDER( 8, 134, (SUBWINDOW_WIDTH)-80, 10, "Alpha:", .2, 8, "tj_cgazalpha" 0 0 1, "Use the slider to increase or decrease CGaz opacity" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 134, 100, 10, "", .2, 8, "tj_cgazalpha", 4, 4, "Current CGaz Opacity" )

	SLIDER( 8, 146, (SUBWINDOW_WIDTH)-80, 10, "Width:", .2, 8, "tj_cgazwidth" 0 100 640, "Use the slider to increase or decrease CGaz width" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 146, 100, 10, "", .2, 8, "tj_cgazwidth", 3, 3, "Current CGaz Width" )
	
	SLIDER( 8, 158, (SUBWINDOW_WIDTH)-80, 10, "Height:", .2, 8, "tj_cgazheight" 0 1 240, "Use the slider to increase or decrease CGaz height" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 158, 100, 10, "", .2, 8, "tj_cgazheight", 3, 3, "Current CGaz Height" )	
	
	SLIDER( 8, 170, (SUBWINDOW_WIDTH)-80, 10, "Y Position:", .2, 8, "tj_cgazy" 0 0 480, "Use the slider to increase or decrease CGaz Vertical(y) Position" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 170, 100, 10, "", .2, 8, "tj_cgazy", 3, 3, "Current CGaz Y Position" )

	
	SUBWINDOW( 6, 194, (SUBWINDOW_WIDTH), 154, "Drawkeys Configuration" )
	// Again, cba, naturally
	itemDef {
		name		"keyset_1"
		rect		12 212 64 64	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/keyset1"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	itemDef {
		name		"keyset_2"
		rect		81 212 64 64	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/keyset2"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}
	itemDef {
		name		"keyset_3"
		rect		150 212 64 64	// X Y W H
		style		WINDOW_STYLE_SHADER
		background	"ui/assets/keyset3"
		forecolor	1 1 1 0.75
		visible		1
		decoration
	}	
	MULTI( 8, 282, (SUBWINDOW_WIDTH)-5, 10, "Draw Keys:", .2, 8, "tj_drawkeys", cvarFloatList { "Off" 0 "Keyset 1" 1 "Keyset 2" 2 "Keyset 3" 3 },  "Which keyset to show, or NOT show it" )
	MULTI( 8, 294, (SUBWINDOW_WIDTH)-5, 10, "Keyset color:", .2, 8, "tj_keyscolor", cvarStrList { "White"; "white"; "Yellow"; "yellow"; "Red"; "red"; "Green"; "green"; "Blue"; "blue"; "Magenta"; "magenta"; "Cyan"; "cyan"; "Orange"; "orange"; "Light Blue"; "0xa0c0ff"; "Medium Blue"; "mdblue"; "Light Red"; "0xffc0a0"; "Medium Red"; "mdred"; "Light Green"; "0xa0ffc0"; "Medium Green"; "mdgreen"; "Dark Green"; "dkgreen"; "Medium Cyan"; "mdcyan"; "Medium Yellow"; "mdyellow"; "Medium Orange"; "mdorange"; "Light Grey"; "ltgrey"; "Medium Grey"; "mdgrey"; "Dark Grey"; "dkgrey"; "Black"; "black" },  "Which color to use for the keyset, or to use default" )
	
	SLIDER( 8, 306, (SUBWINDOW_WIDTH)-80, 10, "Size:", .2, 8, "tj_keyssize" 5 20 200, "Use the slider to increase or decrease Keyset size" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 306, 100, 10, "", .2, 8, "tj_keyssize", 3, 3, "Current Keyset size" )
	
	// Added space in the "TEXT" to avoid conflicting.. + matched @ layout! ;D
	SLIDER( 8, 318, (SUBWINDOW_WIDTH)-80, 10, " Y Position:", .2, 8, "tj_keysy" 5 0 480, "Use the slider to increase or decrease Keyset Vertical(y) Position" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 318, 100, 10, "", .2, 8, "tj_keysy", 3, 3, "Current Keyset Y Position" )
	
	SLIDER( 8, 330, (SUBWINDOW_WIDTH)-80, 10, " X Position:", .2, 8, "tj_keysx" 5 0 640, "Use the slider to increase or decrease Keyset Horizontal(x) Position" )
	EDITFIELDLEFT( SUBWINDOW_WIDTH-60, 330, 100, 10, "", .2, 8, "tj_keysx", 3, 3, "Current Keyset X Position" )
	
		
	// Back button, all stuff is saved dynamically
	BUTTON( 6, WINDOW_HEIGHT-24, (WINDOW_WIDTH-12), 18, "BACK", .3, 14,	close tjmod_hud ; open tjmod )
}
