#include "ui/menudef.h"

{

    menuDef {
	name "cdkey_menu"
	background "rq3-ta-menuback"				// Makro: replace "rq3-ta-menuback" with "rq3-menuback"
								// to use the old background
	fullScreen MENU_TRUE
	visible MENU_FALSE				// Visible on open
	focusColor RQ3_MAIN_FOCUSCOLOR			// Menu focus color for text and items

	onClose { uiScript verifyCDKey }

	onOpen { play "sound/misc/menu1.wav" ; hide verify_text ; uiScript getCDKey }

	onEsc { close cdkey_menu ; open setup_menu ; }


//===================
// RQ3 stuff
//===================


    itemDef {
	name top_bar 				//rq3: Top bar
	rect 0 0 640 56
	style 1
	backcolor RQ3_MAIN_BAR_COLOR
	//border 2
	//bordersize 1
	//bordercolor 1 0 0 1
	decoration
	visible 1
    }

    itemDef {
	name top_bar 				//rq3: Top bar
	rect 0 58 640 12
	style WINDOW_STYLE_SHADER
	background "ui/assets/rq3-main-shadow-1"
	decoration
	visible 1
    }

    itemDef {
	name top_bar2 				//rq3: Top bar - border
	rect 0 56 640 2
	style 1
	backcolor RQ3_MAIN_BAR_COLOR2
	//border 2
	//bordersize 1
	//bordercolor 1 0 0 1
	decoration
	visible 1
    }

    itemDef {
	name bottom_bar 				//rq3: bottom bar
	rect 0 420 640 60
	style 1
	backcolor RQ3_MAIN_BAR_COLOR
	//border 2
	//bordersize 1
	//bordercolor 1 0 0 1
	decoration
	visible 1
    }

    itemDef {
	name bottom_bar2 				//rq3: bottom bar - border
	rect 0 418 640 2
	style 1
	backcolor RQ3_MAIN_BAR_COLOR2
	//border 2
	//bordersize 1
	//bordercolor 1 0 0 1
	decoration
	visible 1
    }

    itemdef {
	name "cdkey_icon"
	style WINDOW_STYLE_SHADER
	rect 8 8 48 48
	background UI_ASSETS"/icons/rq3-setup-cdkey.tga"
	decoration
	visible 1
    }

    itemdef {
	name "cdkey_title"
	style WINDOW_STYLE_SHADER
	rect 64 12 256 32
	background UI_ASSETS"/icons/rq3-title-setup.tga"
	decoration
	visible 1
    }

    itemdef {
	name overlay
	style 1
	forecolor 0 0 0 1
	backcolor RQ3_MENU_OVERLAY_COLOR
	rect 0 58 640 360
	visible 1
	decoration
        }

//=================
// Buttons, lists
//=================


//Background window

    itemdef {
	rect 188 140 264 160
	style WINDOW_STYLE_FILLED
	backcolor Ig_Window_Color
	visible 1
	border 1
	bordersize 1
	shadowStyle 1
	bordercolor Ig_Window_BorderColor
	decoration
    }

//CD Key Check

    itemdef {
	name "enterkey_text"
	rect 160 168 320 20
	style WINDOW_STYLE_EMPTY
	text "Enter your CD key in the field below"
	textstyle 3
	textscale .25
	textalign ITEM_ALIGN_CENTER
	textalignx 160
	textaligny 14
	forecolor 1 1 1 1
	visible 1
	decoration
    }

    itemdef {
	name "key1"
	rect 208 200 40 20
	type ITEM_TYPE_EDITFIELD
	style WINDOW_STYLE_FILLED
	maxchars 4
	cvar "cdkey1"
	text ""
	forecolor 1 1 1 1
	border 1
	bordersize 1
	bordercolor .5 .5 .5 .75
	backcolor 1 1 1 .1
	textscale .25
	textalign ITEM_ALIGN_LEFT
	textalignx 4
	textaligny 14
	onfocus { setcolor backcolor 1 1 1 .2 ; }
	leavefocus { setcolor backcolor 1 1 1 .1 ; }
	visible 1
    }

    itemdef {
	name "key2"
	rect 256 200 40 20
	type ITEM_TYPE_EDITFIELD
	style WINDOW_STYLE_FILLED
	maxchars 4
	cvar "cdkey2"
	text ""
	forecolor 1 1 1 1
	border 1
	bordersize 1
	bordercolor .5 .5 .5 .75
	backcolor 1 1 1 .1
	textscale .25
	textalign ITEM_ALIGN_LEFT
	textalignx 4
	textaligny 14
	onfocus { setcolor backcolor 1 1 1 .2 ; }
	leavefocus { setcolor backcolor 1 1 1 .1 ; }
	visible 1
    }

    itemdef {
	name "key3"
	rect 304 200 40 20
	type ITEM_TYPE_EDITFIELD
	style WINDOW_STYLE_FILLED
	maxchars 4
	cvar "cdkey3"
	text ""
	forecolor 1 1 1 1
	border 1
	bordersize 1
	bordercolor .5 .5 .5 .75
	backcolor 1 1 1 .1
	textscale .25
	textalign ITEM_ALIGN_LEFT
	textalignx 4
	textaligny 14
	onfocus { setcolor backcolor 1 1 1 .2 ; }
	leavefocus { setcolor backcolor 1 1 1 .1 ; }
	visible 1
    }

    itemdef {
	name "key4"
	rect 352 200 40 20
	type ITEM_TYPE_EDITFIELD
	style WINDOW_STYLE_FILLED
	maxchars 4
	cvar "cdkey4"
	text ""
	forecolor 1 1 1 1
	border 1
	bordersize 1
	bordercolor .5 .5 .5 .75
	backcolor 1 1 1 .1
	textscale .25
	textalign ITEM_ALIGN_LEFT
	textalignx 4
	textaligny 14
	onfocus { setcolor backcolor 1 1 1 .2 ; }
	leavefocus { setcolor backcolor 1 1 1 .1 ; }
	visible 1
    }

    itemdef {
	name "separator"
	rect 392 200 20 20
	style WINDOW_STYLE_EMPTY
	forecolor 1 1 1 1
	text "-"
	textscale .25
	textalign ITEM_ALIGN_CENTER
	textalignx 10
	textaligny 14
	visible 1
	decoration
    }

    itemdef {
	name "key_checksum"
	rect 412 200 24 20
	type ITEM_TYPE_EDITFIELD
	style WINDOW_STYLE_FILLED
	maxchars 2
	cvar "cdkeychecksum"
	text ""
	forecolor 1 1 1 1
	border 1
	bordersize 1
	bordercolor .5 .5 .5 .75
	backcolor 1 1 1 .1
	textscale .25
	textalign ITEM_ALIGN_LEFT
	textalignx 4
	textaligny 14
	onfocus { setcolor backcolor 1 1 1 .2 ; }
	leavefocus { setcolor backcolor 1 1 1 .1 ; }
	visible 1
    }

//Verify

    itemdef {
	name "btn_verify"
	rect 352 264 80 20
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_FILLED
	text "Verify"
	textstyle 0
	textscale .25
	textalign ITEM_ALIGN_CENTER
	textalignx 40
	textaligny 14
	//border 1
	//bordersize 1
	//bordercolor .5 .5 .5 .75
	forecolor 1 1 1 1
	backcolor Ig_Sub_Color1
	visible 1
	action { play "sound/misc/menu1.wav" ; uiScript verifyCDKey ; show verify_text ; }
	onFocus { setcolor backcolor Ig_Sub_Color2 }
	leaveFocus { setcolor backcolor Ig_Sub_Color1 }
    }

    itemdef {
	name "verify_text"
	rect 160 236 320 20
	type ITEM_TYPE_EDITFIELD
	cvar ui_cdkeyvalid
	style WINDOW_STYLE_EMPTY
	text ""
	textstyle 3
	textscale .25
	textalign ITEM_ALIGN_CENTER
	textalignx 160
	textaligny 12
	forecolor 1 1 0 .75
	visible 0
	decoration
    }

///Back

    itemdef {
	name "btn_back"
	shortcutKey "B"
	rect 12 432 32 32
	style WINDOW_STYLE_SHADER
	background UI_ASSETS"/icons/rq3-menu-back.tga"
	type 1
	visible 1
	action { close *self; open setup_menu ; }
	onFocus { setbackground UI_ASSETS"/icons/rq3-menu-back-focus-anim" ;
		show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
	leaveFocus { setbackground UI_ASSETS"/icons/rq3-menu-back.tga" ;
		timeFade back_hint forecolor .9 .9 .9 0 0 250 }
    }

    itemdef {
	name back_hint
	text "Go ^_b^_ack to setup menu"
	forecolor RQ3_MAIN_HINT_COLOR
	textalign 1
	textalignx 240
	textaligny 20
	textscale RQ3_MAIN_TEXTSIZE
	rect 80 420 480 40
	type 0
	style 0
	visible 0
	decoration
    }

}
}
