createvar grass_position_hor
createvar grass_position_vert
createvar grass_width
createvar grass_height
createvar grass_row_space
createvar _grass_position_hor
createvar _grass_position_vert


createvar grassiconwidth
createvar grassiconheight

set grassiconwidth 64
set grassiconheight 48

//-------size-------------------------------------
set grass_position_hor 5
set grass_position_vert 44
set grass_width 200
set grass_height 261
//-----end-size-----------------------------------



set grass_row_space 0

set _grass_position_hor #grass_position_hor#
inc _grass_position_hor 14

set _grass_position_vert #grass_position_vert#
inc _grass_position_vert 12



create panel grass $_grass_position_hor$ $_grass_position_vert$ 120 100


//create graphic selected120u 0 0 120 16
//	param image 1_nl_selected120x16.tga
//	param interactive 0
//hide selected120u



create graphic foliagefalloff 20 $grass_row_space$ 60 16
		param text "Falloff:"

create button foliagefalloffdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageFalloff -65; if [gfx_foliageFalloff < 0] gfx_foliageFalloff 0"
	param text "dn"

create button foliagefalloffup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageFalloff 65"
	param text "up"

inc grass_row_space 20

//---------------------------------------------------------------


create graphic foliageHeight 20 $grass_row_space$ 60 16
		param text "Height:"

create button foliageheightdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageHeight -1; if [gfx_foliageHeight < 1] gfx_foliageHeight 1"
	param text "dn"

create button foliageheightup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageHeight 1"
	param text "up"

inc grass_row_space 20

//---------------------------------------------------------------


create graphic foliagewidth 20 $grass_row_space$ 60 16
		param text "Width:"

create button foliagewidthdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageWidth -1; if [gfx_foliageWidth < 1] gfx_foliageWidth 1"
	param text "dn"

create button foliagwidthup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageWidth 1"
	param text "up"

inc grass_row_space 20

//---------------------------------------------------------------

createvar densityX
densityX 3



create graphic foliageDensityX 20 $grass_row_space$ 60 16
		param text "Density X:"

create button foliageDensityXhdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc densityX 1; if [densityX > 5] densityX 5; gfx_foliageDensityX [2^densityX]"
	param text "dn"

create button foliageDensityXup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc densityX -1; if [densityX < 0] densityX 0; gfx_foliageDensityX [2^densityX]"
	param text "up"

inc grass_row_space 20

//---------------------------------------------------------------


createvar densityY
densityY 3


create graphic foliageDensityY 20 $grass_row_space$ 60 16
		param text "Density Y:"

create button foliageDensityYhdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc densityY 1; if [densityY > 5] densityY 5; gfx_foliageDensityY [2^densityY]"
	param text "dn"

create button foliageDensityYup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc densityY -1; if [densityY < 0] densityY 0; gfx_foliageDensityY [2^densityY]"
	param text "up"

inc grass_row_space 20


//---------------------------------------------------------------


create graphic foliageRandomSize 20 $grass_row_space$ 60 16
		param text "Random:"

create button foliageRandomSizedown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageRandomSize -1; if [gfx_foliageRandomSize < 0] gfx_foliageRandomSize 0"
	param text "dn"

create button foliagefoliageRandomSizeup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageRandomSize 1; if [gfx_foliageRandomSize > 30] gfx_foliageRandomSize 30"
	param text "up"

inc grass_row_space 20


//---------------------------------------------------------------


create graphic foliageAnimateSpeed 20 $grass_row_space$ 60 16
		param text "Sway Speed:"

create button foliageAnimateSpeeddown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageAnimateSpeed -0.1; if [gfx_foliageAnimateSpeed < 0] gfx_foliageAnimateSpeed 0"
	param text "dn"

create button foliageAnimateSpeedup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageAnimateSpeed 0.1; if [gfx_foliageAnimateSpeed > 30] gfx_foliageAnimateSpeed 30"
	param text "up"

inc grass_row_space 20


//---------------------------------------------------------------


create graphic foliageAnimateStrength 20 $grass_row_space$ 60 16
		param text "Sway:"

create button foliageAnimateStrengthdown 103 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageAnimateStrength -1; if [gfx_foliageAnimateStrength < 0] gfx_foliageAnimateStrength 0"
	param text "dn"

create button foliageAnimateStrengthup 138 $grass_row_space$ 32 16
	param up_image button120x16.tga
	param down_image button120x16_down.tga
	param command "inc gfx_foliageAnimateStrength 1; if [gfx_foliageAnimateStrength > 30] gfx_foliageAnimateStrength 30"
	param text "up"

inc grass_row_space 15



create graphic grassthumb 48 $grass_row_space$ $grassiconwidth$ $grassiconheight$
		param image /textures/foliage/foliage_grass.tga



create menu "texturemenu" 0 210 80
		param bg_color        0 0 0
		param text_color      1 1 1
		param highlight_color 1 1 .2



menu itemizefiles grass:texturemenu /../game/textures/foliage *.tga "gfx_foliageShader /../game/textures/foliage/#grass:texturemenu#.tga;select grass:grassthumb; param image /../game/textures/foliage/#grass:texturemenu#.tga"


create panel grassframe $grass_position_hor$ $grass_position_vert$ $grass_width$ $grass_height$




create floater "grass_frame" 0 0 $grass_width$ $grass_height$ 		
set framewidth $grass_width$
set frameheight $grass_height$
exec ui_frame.cfg


panel link grass grassframe

hide grass
hide grassframe
