createvar fog_position_hor
createvar fog_position_vert
createvar fog_width
createvar fog_height
createvar fog_row_space
createvar _fog_position_hor
createvar _fog_position_vert



//-------size-------------------------------------
set fog_position_hor 5
set fog_position_vert 670
set fog_width 220
set fog_height 97
//-----end-size-----------------------------------



set fog_row_space 0

set _fog_position_hor #fog_position_hor#
inc _fog_position_hor 14

set _fog_position_vert #fog_position_vert#
inc _fog_position_vert 12



create panel fog $_fog_position_hor$ [_fog_position_vert + 4] 120 100



create swatch "swatch" 156 1 30 64
		param variables gfx_fogr gfx_fogg gfx_fogb





create graphic near 0 $fog_row_space$ 50 16
	param text "Near:"

create textbox "fog_near_text" 50 $fog_row_space$ 60 6 gfx_fog_near 25

create spinner "near_spinner_up" 130 $fog_row_space$ 16 16
		param variable gfx_fog_near
		param range 1 20000
		param strength 100
		param up_image spinner.tga
		param down_image spinner_down.tga
		on mouseover "if [gfx_fog_far < gfx_fog_near] set gfx_fog_far [gfx_fog_near + 1]"

	
inc fog_row_space 20

create graphic far 0 $fog_row_space$ 50 16
	param text "Far:"

create textbox "fog_far_text" 50 $fog_row_space$ 60 6 gfx_fog_far 25

create spinner "far_spinner_up" 130 $fog_row_space$ 16 16
		param variable gfx_fog_far
		param range 1 20000
		param strength 100
		param up_image spinner.tga
		param down_image spinner_down.tga
		on mouseover "if [gfx_fog_far < gfx_fog_near] set gfx_fog_far [gfx_fog_near + 1]"		
		

// want this somwhere if [gfx_fog_far < gfx_fog_near] gfx_fog_far gfx_fog_near
		

inc fog_row_space 24

create togglebutton fogbutton 0 $fog_row_space$ 120 16 
		param up_image button120x16_down.tga
		param down_image button120x16.tga
		param command "gfx_fog 0"
		param up_command "gfx_fog 1"
		param text "Fog On/Off"
		



	



create panel fogframe $fog_position_hor$ $fog_position_vert$ $fog_width$ $fog_height$


create floater "fog_frame" 0 0 $fog_width$ $fog_height$ 		
set framewidth $fog_width$
set frameheight $fog_height$
exec ui_frame.cfg


panel link fog fogframe
hide fog 
hide fogframe
