#include "ui/menudef.h"

#define ICON_ALPHA 0.5
#define LINE_ALPHA 0.2

#define RQ3_Controls_Option_Color 0 0 .1 1
#define RQ3_Controls_Tab_Color1 0 0 0 1
#define RQ3_Controls_Tab_Color2 .4 .4 .4 1


{
  assetGlobalDef {
    font "fonts/font" 16				// font
    smallFont "fonts/smallfont" 12			// font
    bigFont "fonts/bigfont" 20				// font
    //cursor "gfx/rq3_ta_hud/3_cursor2.tga"		// cursor
	cursor UI_ASSETS"/cursor.tga"
    cursorSize 64
    gradientBar UI_ASSETS"/gradientbar2.tga"		// gradient bar
    itemFocusSound "sound/ui/whoosh2.wav"		// sound for item getting focus (via keyboard or mouse )
	
	//Makro - checkboxes
	checkBox0 UI_ASSETS"/checkbox_0.tga"
	checkBox1 UI_ASSETS"/checkbox_1.tga"

    fadeCycle 2						// how often fade happens in milliseconds
    fadeAmount 0.05					// amount to adjust alpha per cycle
    fadeClamp 1.0					// sets the fadeup alpha

    shadowColor 0.1 0.1 0.1 0.25			// shadow color
	keyBindStatus1 "ENTER or CLICK to change, BACKSPACE to clear"
	keyBindStatus2 "Waiting for new key... Press ESCAPE to cancel"
  }


  menuDef {
    name "main"							// Makro: rename it to "main-rq3"
    //background "rq3-ta-menuback"				// Makro: replace "rq3-ta-menuback" with "rq3-menuback"
    background UI_ASSETS"/main"				// Makro: replace "rq3-ta-menuback" with "rq3-menuback"
    fullScreen MENU_TRUE

    //rect 0 0 640 480				// Size and position of the menu
    visible 0				// Visible on open
    focusColor RQ3_MAIN_FOCUSCOLOR				// Menu focus color for text and items
    //soundLoop "music/rq3_title_loop"
    //soundIntro "music/rq3_title_intro"


    onOpen {
      play "sound/ui/whoosh3.wav" ;
      uiScript stopRefresh ;
    }

    onFirstShow {
	  setoverlaycolor 0 0 0 1 ;
	  fadeoverlay 0 0 0 0 0 1000 ;
	  setfocus btn_join ;
    }

    onESC { open quit_popmenu }



//--------------------------------------------
#include "ui/shared.h"
//--------------------------------------------


	__BOOMSTICK_LOGO__


//Join server

	itemdef {
	name "btn_join"
	text "> ^_J^_oin server "
	shortcutKey "J"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	rect 108 112 96 24
	//anglevectors 9 -81
	anglevectors 8.8 -80.6
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { openSpecial joinserver }
    }

	itemdef {
	text "Join an existing Reaction game"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_join" ITEM_ALIGN_LEFT 0 20 96 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }


//Create server

	itemdef {
	name "btn_create"
	text "> ^_C^_reate server"
	shortcutKey "C"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	alignrect "btn_join" ITEM_ALIGN_LEFT 0 36 112 24
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { openSpecial createserver }
    }

	itemdef {
	text "Start up a new Reaction server"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_create" ITEM_ALIGN_LEFT 0 20 96 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }


//Setup

	itemdef {
	name "btn_setup"
	text "> ^_O^_ptions"
	shortcutKey "O"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	alignrect "btn_create" ITEM_ALIGN_LEFT 0 36 96 24
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { openspecial setup_menu }
    }

	itemdef {
	text "Configure Reaction"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 0 36 96 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }

	// Sub-options //

	//Player
	itemdef {
	text "^_P^_layer."
	shortcutKey "P"
	forecolor 0 0 0 1
	textalign 0
	textalignx 4
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 8 24 34 16
	style WINDOW_STYLE_EMPTY
	type ITEM_TYPE_BUTTON
	action { openspecial player_menu ; }
	visible 1
    }

	//Control
	itemdef {
	text "Co^_n^_trols."
	shortcutKey "N"
	forecolor 0 0 0 1
	textalign 0
	textalignx 4
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 44 24 46 16
	style WINDOW_STYLE_EMPTY
	type ITEM_TYPE_BUTTON
	action { openspecial controls_menu ; }
	visible 1
    }

	//System
	itemdef {
	text "^_S^_ystem."
	shortcutKey "S"
	forecolor 0 0 0 1
	textalign 0
	textalignx 4
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 92 24 42 16
	style WINDOW_STYLE_EMPTY
	type ITEM_TYPE_BUTTON
	action { openspecial system_menu ; }
	visible 1
    }

	//Game
	itemdef {
	text "^_G^_ame."
	shortcutKey "G"
	forecolor 0 0 0 1
	textalign 0
	textalignx 4
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 136 24 32 16
	style WINDOW_STYLE_EMPTY
	type ITEM_TYPE_BUTTON
	action { openspecial options_menu ; }
	visible 1
    }

	//Replacements
	itemdef {
	text "^_R^_eplacements."
	shortcutKey "R"
	forecolor 0 0 0 1
	textalign 0
	textalignx 4
	textaligny 12
	textscale 0.2
	alignrect "btn_setup" ITEM_ALIGN_LEFT 170 24 72 16
	style WINDOW_STYLE_EMPTY
	type ITEM_TYPE_BUTTON
	action { open replacements_menu ; }
	visible 1
    }


//Demos

    itemdef {
	text "> ^_D^_emos"
	shortcutKey "D"
	name "btn_demo"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	alignrect "btn_setup" ITEM_ALIGN_LEFT 0 52 96 24
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { openSpecial demo }
    }

	itemdef {
	text "Playback in-game demos"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_demo" ITEM_ALIGN_LEFT 0 20 96 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }


//Mods

    itemdef {
	text "> ^_M^_ods"
	shortcutKey "M"
	name "btn_mod"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	alignrect "btn_demo" ITEM_ALIGN_LEFT 0 36 96 24
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { openSpecial mod }
    }

	itemdef {
	text "Select a modification"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_mod" ITEM_ALIGN_LEFT 0 20 96 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }

//Quit

    itemdef {
	text "> ^_Q^_uit"
	shortcutKey "Q"
	name "btn_quit"
	forecolor 0 0 0 1
	textalign 0
	textalignx 0
	textaligny 20
	textscale UI_MAIN_TEXTSIZE
	alignrect "btn_mod" ITEM_ALIGN_LEFT 0 36 96 24
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	visible 1
	action { open quit_popmenu }
    }

	itemdef {
	autowrapped
	text "Exit Reaction"
	forecolor .25 .25 .25 1
	textalign 0
	textalignx 12
	textaligny 12
	textscale 0.2
	alignrect "btn_quit" ITEM_ALIGN_LEFT 0 20 240 24
	type ITEM_TYPE_TEXT
	style 0
	visible 1
	decoration
    }

/*
    itemDef {
		cvarTest "developer"
		showCvar { "1" }
		text "> Test"
		forecolor 0 0 0 1
		textalign 0
		textalignx 0
		textaligny 20
		textscale UI_MAIN_TEXTSIZE
		alignrect "btn_quit" ITEM_ALIGN_LEFT 0 36 96 24
		type ITEM_TYPE_BUTTON
		style WINDOW_STYLE_EMPTY
		visible 1
		action { open alphabet }
    }
*/

}


  // UNDER CONSTRUCTION MENU //

    menuDef {
	name "notdone_popmenu"
	visible 0
	rect 348 182 144 128
	anglevectors -10 -100
	focusColor .25 .25 .5 1
	popup
	//onOpen { transition window 0 50 300 0 0 0 300 100 10 4 }
	//onClose { transition window 0 0 300 100 0 50 300 0 10 4 }
	onOpen {
		setrandomitemcolor postit forecolor 2   .94 .94 .82 1    1 .95 .8 1 ;
		setitemcolor window forecolor 2 2 2 0 ;
		timefade window forecolor 2 2 2 1 0 FADEIN_TIME ;
		play "sound/ui/whoosh3.wav" ;
		//setQuitText confirm
	}
	onESC { close _self ; open main }
	onOOBClick { close _self ; open main }


	itemDef {
	renderpoint
	name "postit"
	group window
	style WINDOW_STYLE_SHADER
	//style WINDOW_STYLE_FILLED
	background "ui/assets/post_it"
	forecolor .94 .94 .82 1
	//backcolor .94 .94 .82 1
	rect -16 0 180 152
	anglevectors -10 -100
	visible 1
	decoration
    }



	// MESSAGE	//

    itemDef {
	renderpoint
	name confirm
	group window
	autowrapped
	text "Under construction"
	style WINDOW_STYLE_EMPTY
	backcolor 0 0 0 .1
	textscale .25
	//rect 16 24 112 32
	alignrect "postit" ITEM_ALIGN_CENTER 0 24 112 32
	adjustrect
	textalign 1
	textalignx 56
	textaligny 16
	decoration
	forecolor 0 0 .15 1
	visible 1
    }


    // OK	//

    itemDef {
	name ok
	group window
	text "^_O^_K"
	shortcutKey "O"
	type ITEM_TYPE_BUTTON
	style WINDOW_STYLE_EMPTY
	backcolor 0 0 0 .1
	textscale .25
	//rect 32 88 32 16
	//anglevectors -15 -105
	alignrect confirm ITEM_ALIGN_CENTER 0 56 32 16
	textalign ITEM_ALIGN_CENTER
	textalignx 16
	textaligny 12
	forecolor 0 0 .15 1
	visible 1
	action { close _self ; open _prev }
    }

}

