#include "ui/menudef.h"

// Defines //

#define WINDOW_X		0
#define WINDOW_Y		0
#define WINDOW_WIDTH	640
#define WINDOW_HEIGHT	480
#define GROUP_NAME		"grpQuit"

// Macros //

#include "ui/menumacros.h"
		
// Quit Menu //
	
menuDef {
	name		"quit"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	popup
	
	fadeClamp	0.5
	fadeAmount  0.075
	
	onOpen {
		setitemcolor background backcolor 0 0 0 0 ;
		fadein background
	}
	
	onESC {
		close quit ;
#ifdef FUI
		open main
#else
		open ingame_main
#endif // FUI
	}
	
// Background //

	itemDef {
		name		"background"
		rect		0 0 640 480
		style		WINDOW_STYLE_FILLED
		background	"ui/assets/fadebox.tga"
		backcolor	0 0 0 0
		visible		1
		decoration
	}

// Subwindows //

#define SUBWINDOW_WIDTH		192
#define SUBWINDOW_HEIGHT	80
#define SUBWINDOW_X			.5*(WINDOW_WIDTH-SUBWINDOW_WIDTH)
#define SUBWINDOW_Y			.5*(WINDOW_HEIGHT-SUBWINDOW_HEIGHT)

	SUBWINDOWBLACK( SUBWINDOW_X, SUBWINDOW_Y, SUBWINDOW_WIDTH, SUBWINDOW_HEIGHT, "EXIT GAME" )
	LABEL( SUBWINDOW_X+2, SUBWINDOW_Y+16, (SUBWINDOW_WIDTH)-4, 10, "Yeah, right, like YOU have", .2, ITEM_ALIGN_CENTER, .5*((SUBWINDOW_WIDTH)-4), 8 )
	LABEL( SUBWINDOW_X+2, SUBWINDOW_Y+28, (SUBWINDOW_WIDTH)-4, 10, "anything better to do!", .2, ITEM_ALIGN_CENTER, .5*((SUBWINDOW_WIDTH)-4), 8 )
	
#ifdef FUI
	BUTTON( SUBWINDOW_X+6, SUBWINDOW_Y+SUBWINDOW_HEIGHT-24, .5*(SUBWINDOW_WIDTH-18), 18, "YES", .3, 14, close quit ; close main ; open credits_quit )
	BUTTON( SUBWINDOW_X+6+.5*(SUBWINDOW_WIDTH-18)+6, SUBWINDOW_Y+SUBWINDOW_HEIGHT-24, .5*(SUBWINDOW_WIDTH-18), 18, "NO", .3, 14, close quit ; open main )
#else
	BUTTON( SUBWINDOW_X+6, SUBWINDOW_Y+SUBWINDOW_HEIGHT-24, .5*(SUBWINDOW_WIDTH-18), 18, "YES", .3, 14, close quit ; close ingame_main ; open credits_quit )
	BUTTON( SUBWINDOW_X+6+.5*(SUBWINDOW_WIDTH-18)+6, SUBWINDOW_Y+SUBWINDOW_HEIGHT-24, .5*(SUBWINDOW_WIDTH-18), 18, "NO", .3, 14, close quit ; open ingame_main )
#endif // FUI

}
