#include "ui/menudef.h"

#define FADEIN_TIME	125
#define BACK_COLOR1	.85 .9 .85 1
#define BACK_COLOR2	.95 .95 .98 1

#define ANGLES		-3 -93

{
	// CREATE FAVORITE POPUP MENU //

	menuDef {
		name "createfavorite_popmenu"
		visible 0
		fullscreen 0
		rect 248 200 288 152
		anglevectors ANGLES
		focusColor .25 .25 .5 1
		popup
		style WINDOW_STYLE_EMPTY
		onOpen {
			//setrandomitemcolor postit forecolor 2 BACK_COLOR1 BACK_COLOR2 ;
			setitemcolor window forecolor 5 5 5 0 ;
			timefade window forecolor 5 5 5 1 0 FADEIN_TIME ;
			play "sound/ui/whoosh3.wav" ;
			setQuitText confirm ;
			setfocus nameEntry
		}
		onESC { close _self ; open _prev }
		onOOBClick { close _self ; open _prev }
		
		itemDef {
			renderpoint
			name "postit"
			menuAnchor
			group window
			style WINDOW_STYLE_SHADER
			background UI_ASSETS"/paper_1"
			forecolor 1 1 .92 1
			//backcolor .94 .94 .82 1
			rect -8 -4 320 176
			anglevectors ANGLES
			visible 1
			decoration
		}
		
		// TITLE //
		
		itemdef {
			renderpoint
			name "title"
			text "Add to Favorites:"
			forecolor .6 .0 .0 1
			style WINDOW_STYLE_EMPTY
			textalign ITEM_ALIGN_LEFT
			textalignx 4
			textaligny 24
			textscale RQ3_MAIN_TEXTSIZE
			alignrect postit ITEM_ALIGN_LEFT 32 24 240 36 
			visible 1
			autowrapped
			decoration
		}
		
		// NAME //
		
		itemDef {
			renderpoint
			name "name"
			text "Name:"
			style 0
			decoration
			textscale .25
			alignrect title ITEM_ALIGN_LEFT -8 32 52 20
			textalign ITEM_ALIGN_LEFT
			textalignx 20
			textaligny 16
			forecolor 0 0 .15 1
			visible 1
		}
		
		itemDef {
			name "name_dots"
			text "........................................"
			style 0
			decoration
			textscale .25
			alignrect name ITEM_ALIGN_LEFT 80 2 168 20
			textalign ITEM_ALIGN_LEFT
			textalignx 4
			textaligny 19
			forecolor 0 0 .15 1
			visible 1
		}
		
		itemDef {
			name "nameEntry"
			style WINDOW_STYLE_EMPTY
			text ""
			textalign ITEM_ALIGN_LEFT
			textalignx 4
			textaligny 14
			maxchars 99
			maxPaintChars 15
			textscale .25
			type ITEM_TYPE_EDITFIELD
			cvar "ui_favoriteName"
			alignrect name_dots ITEM_ALIGN_LEFT 0 0 168 20
			forecolor 0 0 .15 1
			backcolor 1 0 0 .5
			visible 1
		}
		
		// ADDRESS //
		
		itemDef {
			renderpoint
			name "address"
			text "Address:"
			style 0
			decoration
			textscale .25
			alignrect name ITEM_ALIGN_LEFT 0 24 52 20
			textalign ITEM_ALIGN_LEFT
			textalignx 20
			textaligny 16
			forecolor 0 0 .15 1
			visible 1
		}
		
		itemDef {
			name "address_dots"
			text "........................................"
			style 0
			decoration
			textscale .25
			alignrect address ITEM_ALIGN_LEFT 80 2 168 20
			textalign ITEM_ALIGN_LEFT
			textalignx 4
			textaligny 19
			forecolor 0 0 .15 1
			visible 1
		}
		
		itemDef {
			name "addressEntry"
			style WINDOW_STYLE_EMPTY
			text ""
			textalign ITEM_ALIGN_LEFT
			textalignx 4
			textaligny 14
			maxPaintChars 15
			maxChars 99
			textscale .25
			type ITEM_TYPE_EDITFIELD
			cvar "ui_favoriteAddress"
			alignrect address_dots ITEM_ALIGN_LEFT 0 0 168 20
			forecolor 0 0 .15 1
			backcolor 1 0 0 .5
			visible 1
		}
		
		// OK //
		
		itemDef {
			text "^_O^_K"
			shortcutKey "O"
			type ITEM_TYPE_BUTTON
			textscale .25
			style WINDOW_STYLE_EMPTY
			alignrect address_dots ITEM_ALIGN_LEFT 136 24 32 20
			textalign 1
			textalignx 12
			textaligny 16
			forecolor 0 0 .15 1
			visible 1
			action { play "sound/ui/whoosh3.wav" ; uiScript CreateFavorite ; close _self ; open joinserver }
		}
	}
}
