#include "ui/menudef.h"

// Defines //

#define WINDOW_X		16
#define WINDOW_Y		16
//#define WINDOW_WIDTH	128
#define WINDOW_WIDTH	160
#define WINDOW_HEIGHT	176
#define GROUP_NAME		"grpIngameMain"

// Macros //

#include "ui/menumacros.h"

// Main Menu //

menuDef {
	name		"ingame_main"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
  
	onOpen {
		// ydnar
		conditionalscript ROldModeCheck 2
			( "clearFocus ; open vid_confirm" )
			( "clearFocus" )
	}
	
	onEsc {
		close ingame_main ;
	}
	
	// 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( "MAIN", 50 )
	
// Buttons //

	BUTTONEXT( 6, 32, WINDOW_WIDTH-12, 18, "VOTE", .3, 14, uiScript clientCheckVote ; 
															conditionalScript cg_ui_novote 0
																( "clearFocus ; open ingame_votedisabled" )
																( "close ingame_main ; open ingame_vote" ),
															cvarTest "authLevel" showCVar { RL_NONE } )
	BUTTONEXT( 6, 32, WINDOW_WIDTH-12, 18, "REFEREE", .3, 14, close ingame_main ; open ingame_vote, cvarTest "authLevel" showCVar { RL_REFEREE } )
	BUTTONEXT( 6, 32, WINDOW_WIDTH-12, 18, "RCON", .3, 14, close ingame_main ; open ingame_vote, cvarTest "authLevel" showCVar { RL_RCON } )
	BUTTON( 6, 56, WINDOW_WIDTH-12, 18, "SERVER INFO", .3, 14, clearFocus ; open ingame_serverinfo )
	BUTTON( 6, 80, WINDOW_WIDTH-12, 18, "^fTJMOD", .3, 14, close ingame_main ; open tjmod )
	BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "OPTIONS", .3, 14, close ingame_main ; open options )
	BUTTON( 6, 128, WINDOW_WIDTH-12, 18, "DISCONNECT", .3, 14, clearFocus ; open ingame_disconnect )
	BUTTON( 6, 152, WINDOW_WIDTH-12, 18, "EXIT GAME", .3, 14, clearFocus ; open quit )
}
