createvar texture_position_hor
createvar texture_position_vert
createvar texture_width
createvar texture_height
createvar texture_row_space
createvar _texture_position_hor
createvar _texture_position_vert



//-------size-------------------------------------
set texture_position_hor 5
set texture_position_vert 370
set texture_width 196
set texture_height 296
//-----end-size-----------------------------------



set texture_row_space 0

set _texture_position_hor #texture_position_hor#
inc _texture_position_hor 11

set _texture_position_vert #texture_position_vert#
inc _texture_position_vert 12





create panel texture $_texture_position_hor$ $_texture_position_vert$ 120 100




// layers

set le_layer2 0

	create graphic "layerover" 10 30 120 16
		param image 1_nl_selected120x16.tga

	create button "butlayer1" 10 10 120 16
		param up_image button120x16.tga
		param command "le_layer2 1; move layerover 10 10"
		param text "Layer 2"


	create button "butlayer2" 10 30 120 16
		param up_image button120x16.tga
		param command "le_layer2 0; move layerover 10 30"
		param text "Layer 1"






// Texture category menu
	create menu "textureCategory" 10 50 160
		param bg_color		0	0	0
		param text_color	1	1	1
		param highlight_color	1	1	0
		//param char_height 12

// Texture grid

	create thumbnailgrid "texturegrid" 135 70 6 24 le_terrainshader "exec /gui/jesse/ui_texture_mode.cfg"

	menu itemizedirs "textureCategory" /../game/textures/terrain "thumbnailgrid clear texturegrid; thumbnailgrid add_directory texturegrid /../game/textures/terrain/#textureCategory#"




// Toggle Icon As Visible
togglebutton down icon_bar:texture_button



create panel textureframe $texture_position_hor$ $texture_position_vert$ $texture_width$ $texture_height$


create floater "texture_frame" 0 0 $texture_width$ $texture_height$ 		
set framewidth $texture_width$
set frameheight $texture_height$
exec ui_frame.cfg

hide textureframe
hide texture


panel link texture textureframe
