#define PRAGMA_PATH "files"

BMAP* kl_button1_tga = "kl_button1.tga";
BMAP* kl_button2_tga = "kl_button2.tga";
BMAP* kl_button3_tga = "kl_button3.tga";
BMAP* kl_button4_tga = "kl_button4.tga";
BMAP* kl_button5_tga = "kl_button5.tga";
BMAP* kl_button6_tga = "kl_button6.tga";

BMAP* window_titlebar_left_tga = "window_titlebar_left.tga";
BMAP* window_titlebar_middle_tga = "window_titelbar_middle.tga";
BMAP* window_titlebar_right_tga = "window_titlebar_right.tga";
BMAP* window_titlebar_seperator_tga = "window_titlebar_seperator.tga";

BMAP* window_border_left_tga = "window_border_left.tga";
BMAP* window_border_right_tga = "window_border_right.tga";
BMAP* window_border_bottomleft_tga = "window_border_bottomleft.tga";
BMAP* window_border_bottom_tga = "window_border_bottom.tga";
BMAP* window_border_bottomright_tga = "window_border_bottomright.tga";

BMAP* window_content_topleft_tga = "window_content_topleft.tga";
BMAP* window_content_top_tga = "window_content_top.tga";
BMAP* window_content_topright_tga = "window_content_topright.tga";
BMAP* window_content_left_tga = "window_content_left.tga";
BMAP* window_content_right_tga = "window_content_right.tga";
BMAP* window_content_bottomleft_tga = "window_content_bottomleft.tga";
BMAP* window_content_bottom_tga = "window_content_bottom.tga";
BMAP* window_content_bottomright_tga = "window_content_bottomright.tga";
BMAP* window_content_center_tga = "window_content_center.tga";

BMAP* xbutton1_tga = "xbutton1.tga";
BMAP* xbutton2_tga = "xbutton2.tga";
BMAP* xbutton3_tga = "xbutton3.tga";
BMAP* maxbutton1_tga = "maxbutton1.tga";
BMAP* maxbutton2_tga = "maxbutton2.tga";
BMAP* maxbutton3_tga = "maxbutton3.tga";
BMAP* resbutton1_tga = "resbutton1.tga";
BMAP* resbutton2_tga = "resbutton2.tga";
BMAP* resbutton3_tga = "resbutton3.tga";
//
BMAP* checkbox_default_tga = "checkbox_default.tga";
BMAP* checkbox_over_tga = "checkbox_over.tga";
BMAP* checkbox_checked_tga = "checkbox_checked.tga";
BMAP* checkbox_checked_over_tga = "checkbox_checked_over.tga";
BMAP* checkbox_disabled_tga = "checkbox_disabled.tga";
BMAP* checkbox_checked_disabled_tga = "checkbox_checked_disabled.tga";

BMAP* radiobutton_default_tga = "radiobutton_default.tga";
BMAP* radiobutton_over_tga = "radiobutton_over.tga";
BMAP* radiobutton_checked_tga = "radiobutton_checked.tga";
BMAP* radiobutton_checked_over_tga = "radiobutton_checked_over.tga";
BMAP* radiobutton_disabled_tga = "radiobutton_disabled.tga";
BMAP* radiobutton_checked_disabled_tga = "radiobutton_checked_disabled.tga";

BMAP* infobox_topleft_tga = "infobox_topleft.tga";
BMAP* infobox_top_tga = "infobox_top.tga";
BMAP* infobox_topright_tga = "infobox_topright.tga";
BMAP* infobox_left_tga = "infobox_left.tga";
BMAP* infobox_right_tga = "infobox_right.tga";
BMAP* infobox_bottomleft_tga = "infobox_bottomleft.tga";
BMAP* infobox_bottom_tga = "infobox_bottom.tga";
BMAP* infobox_bottomright_tga = "infobox_bottomright.tga";
BMAP* infobox_center_tga = "infobox_center.tga";

BMAP* progressbar_left_tga = "progressbar_left.tga";
BMAP* progressbar_middle_tga = "progressbar_middle.tga";
BMAP* progressbar_right_tga = "progressbar_right.tga";
BMAP* progressbar_bar_tga = "progressbar_bar.tga";

BMAP* hscrollbar_left_tga = "hscrollbar_left.tga";
BMAP* hscrollbar_middle_tga = "hscrollbar_middle.tga";
BMAP* hscrollbar_right_tga = "hscrollbar_right.tga";
BMAP* hscrollbar_bar_tga = "hscrollbar_bar.tga";
BMAP* hscrollbar_corner_tga = "hscrollbar_corner.tga";

BMAP* hscrollbar_left1_tga = "hscrollbar_left1.tga";
BMAP* hscrollbar_left2_tga = "hscrollbar_left2.tga";
BMAP* hscrollbar_left3_tga = "hscrollbar_left3.tga";

BMAP* hscrollbar_right1_tga = "hscrollbar_right1.tga";
BMAP* hscrollbar_right2_tga = "hscrollbar_right2.tga";
BMAP* hscrollbar_right3_tga = "hscrollbar_right3.tga";

BMAP* vscrollbar_top_tga = "vscrollbar_top.tga";
BMAP* vscrollbar_middle_tga = "vscrollbar_middle.tga";
BMAP* vscrollbar_bottom_tga = "vscrollbar_bottom.tga";
BMAP* vscrollbar_bar_tga = "vscrollbar_bar.tga";
BMAP* vscrollbar_corner_tga = "hscrollbar_corner.tga";

BMAP* vscrollbar_up1_tga = "vscrollbar_up1.tga";
BMAP* vscrollbar_up2_tga = "vscrollbar_up2.tga";
BMAP* vscrollbar_up3_tga = "vscrollbar_up3.tga";

BMAP* vscrollbar_down1_tga = "vscrollbar_down1.tga";
BMAP* vscrollbar_down2_tga = "vscrollbar_down2.tga";
BMAP* vscrollbar_down3_tga = "vscrollbar_down3.tga";

BMAP* slider_left_tga = "slider_left.tga";
BMAP* slider_middle_tga = "slider_middle.tga";
BMAP* slider_right_tga = "slider_right.tga";
BMAP* slider_knob1_tga = "slider_knob1.tga";
BMAP* slider_knob2_tga = "slider_knob2.tga";
BMAP* slider_knob3_tga = "slider_knob3.tga";

BMAP* listbox_topleft_tga = "listbox_topleft.tga";
BMAP* listbox_top_tga = "listbox_top.tga";
BMAP* listbox_topright_tga = "listbox_topright.tga";
BMAP* listbox_left_tga = "listbox_left.tga";
BMAP* listbox_right_tga = "listbox_right.tga";
BMAP* listbox_bottomleft_tga = "listbox_bottomleft.tga";
BMAP* listbox_bottom_tga = "listbox_bottom.tga";
BMAP* listbox_bottomright_tga = "listbox_bottomright.tga";
BMAP* listbox_center_tga = "listbox_center.tga";

BMAP* listitem_left_tga = "listitem_left.tga";
BMAP* listitem_middle_tga = "listitem_middle.tga";
BMAP* listitem_right_tga = "listitem_right.tga";

BMAP* listitem_over_left_tga = "listitem_over_left.tga";
BMAP* listitem_over_middle_tga = "listitem_over_middle.tga";
BMAP* listitem_over_right_tga = "listitem_over_right.tga";

BMAP* listitem_marked_left_tga = "listitem_marked_left.tga";
BMAP* listitem_marked_middle_tga = "listitem_marked_middle.tga";
BMAP* listitem_marked_right_tga = "listitem_marked_right.tga";

BMAP* editbox_left_tga = "editbox_left.tga";
BMAP* editbox_middle_tga = "editbox_middle.tga";
BMAP* editbox_right_tga = "editbox_right.tga";

BMAP* combobox_button1_tga = "combobox_button1.tga";
BMAP* combobox_button2_tga = "combobox_button2.tga";
BMAP* combobox_button3_tga = "combobox_button3.tga";

BMAP* brogames_tga = "brogames.tga";

BMAP* mouse_default_tga = "mouse_default.tga";
BMAP* mouse_text_tga = "mouse_text.tga";
BMAP* mouse_scale_hor_tga = "mouse_scale_hor.tga";
BMAP* mouse_scale_ver_tga = "mouse_scale_ver.tga";
BMAP* mouse_scale_diag1_tga = "mouse_scale_diag1.tga";
BMAP* mouse_scale_diag2_tga = "mouse_scale_diag2.tga";

LBG_WBORDER_BMAPS win_bbmaps;
LBG_CBORDER_BMAPS win_cbmaps;
LBG_TBUTTON_BMAPS win_tbmaps;
LBG_CHECKBOX_BMAPS checkbox_bmaps;
LBG_CHECKBOX_BMAPS radiobutton_bmaps;
LBG_SLIDER_BMAPS slider_bmaps;
LBG_PROGRESSBAR_BMAPS progressbar_bmaps;
LBG_LISTBOX_BMAPS listbox_bmaps;
LBG_CBORDER_BMAPS infobox_bmaps;

TEXT* Monster_block =	{string ("Spawn Block:");	font = "Arial#24b";}
TEXT* Monster_uid =	{string ("Monster UID:");	font = "Arial#24b";}
TEXT* Monster_name =	{string ("Monster Name:");	font = "Arial#24b";}
TEXT* Monster_type =	{string ("Monster Type:");	font = "Arial#24b";}
TEXT* Monster_Cood_min = {string ("Spawn Min XY:");	font = "Arial#24b";}
TEXT* Monster_Cood_max = {string ("Spawn Max XY:");	font = "Arial#24b";}
TEXT* Monster_Max_count = {string ("Spawn Max Count:");	font = "Arial#24b";}
TEXT* Monster_Min_count = {string ("Spawn Min Count:");	font = "Arial#24b";}
TEXT* Monster_respawn_time = {string ("Respawn Time:");	font = "Arial#24b";}
TEXT* Monster_Boss = {string ("Is a Boss Monster:");	font = "Arial#24b";}

LBG_EDITBOX* Monsteruidview;
LBG_LISTBOX* Spanwn_block;
LBG_EDITBOX* Monsternameview;
LBG_EDITBOX* Monstertypeview;
LBG_EDITBOX* Monstermincoordview1;
LBG_EDITBOX* Monstermincoordview2;
LBG_EDITBOX* Monstermaxcoordview1;
LBG_EDITBOX* Monstermaxcoordview2;
LBG_EDITBOX* Monstermaxcountview;
LBG_EDITBOX* Monstermincountview;
LBG_EDITBOX* Monsterrespawnview;
LBG_CHECKBOX* radiobutton_a1;
LBG_CHECKBOX* radiobutton_a2;
LBG_BUTTON* button1;
LBG_BUTTON* button2;
int block_befor = 0;
int block_select = 0;
int min_edit_a = 0;
int max_edit_a = 0;

void spawn_edit()
{
	var i = block_select;
	if(min_edit_a == 1 && max_edit_a == 0 )
	{
		while(key_enter == 0)
		{
			CONTACT* c1[5000];
						
			c_move(ball2[i],vector(40*(key_cuu - key_cud)*time_step,40*(key_cul - key_cur)*time_step,NULL),NULLVECTOR,IGNORE_PASSABLE | GLIDE);
			
			c1[i] = ent_getvertex(spawn[i],NULL,2);  
			c1[i].v = NULL;
			c1[i].x = ball1[i].x ;
			c1[i].y = ball1[i].y ;
			ent_setvertex(spawn[i],c1[i],2);
			
			c1[i] = ent_getvertex(spawn[i],NULL,3);  
			c1[i].v = NULL;
			c1[i].x = ball1[i].x ;
			c1[i].y = ball2[i].y ;
			ent_setvertex(spawn[i],c1[i],3);
			
			c1[i] = ent_getvertex(spawn[i],NULL,4);  
			c1[i].v = NULL;
			c1[i].x = ball2[i].x ;
			c1[i].y = ball2[i].y ;
			ent_setvertex(spawn[i],c1[i],4);
			
			c1[i] = ent_getvertex(spawn[i],NULL,1);  
			c1[i].v = NULL;
			c1[i].x = ball2[i].x ;
			c1[i].y = ball1[i].y ;
			ent_setvertex(spawn[i],c1[i],1);
			
			monster_data[i].spawn_min_x = ball2[i].x / 40;
			monster_data[i].spawn_min_y = ball2[i].y / 40;
			
			Monstermincoordview1.caption = str_for_int(NULL,monster_data[i].spawn_min_x);
			LBG_update_editbox(Monstermincoordview1);
			
			Monstermincoordview2.caption = str_for_int(NULL,monster_data[i].spawn_min_y);
			LBG_update_editbox(Monstermincoordview2);
			
			wait(1);
		}
		
		min_edit_a = 0;
	}
	
	if(max_edit_a == 1 && min_edit_a == 0)
	{
		var i = block_select;
		while(key_enter == 0)
		{
			CONTACT* c1[5000];
			
			c_move(ball1[i],vector(40*(key_cuu - key_cud)*time_step,40*(key_cul - key_cur)*time_step,NULL),NULLVECTOR,IGNORE_PASSABLE | GLIDE);
			
			c1[i] = ent_getvertex(spawn[i],NULL,2);  
			c1[i].v = NULL;
			c1[i].x = ball1[i].x ;
			c1[i].y = ball1[i].y ;
			ent_setvertex(spawn[i],c1[i],2);
			
			c1[i] = ent_getvertex(spawn[i],NULL,3);  
			c1[i].v = NULL;
			c1[i].x = ball1[i].x ;
			c1[i].y = ball2[i].y ;
			ent_setvertex(spawn[i],c1[i],3);
			
			c1[i] = ent_getvertex(spawn[i],NULL,4);  
			c1[i].v = NULL;
			c1[i].x = ball2[i].x ;
			c1[i].y = ball2[i].y ;
			ent_setvertex(spawn[i],c1[i],4);
			
			c1[i] = ent_getvertex(spawn[i],NULL,1);  
			c1[i].v = NULL;
			c1[i].x = ball2[i].x ;
			c1[i].y = ball1[i].y ;
			ent_setvertex(spawn[i],c1[i],1);
			
			monster_data[i].spawn_max_x = ball1[i].x / 40;
			monster_data[i].spawn_max_y = ball1[i].y / 40;
			
			Monstermaxcoordview1.caption = str_for_int(NULL,monster_data[i].spawn_max_x);
			LBG_update_editbox(Monstermaxcoordview1);
			
			Monstermaxcoordview2.caption = str_for_int(NULL,monster_data[i].spawn_max_y);
			LBG_update_editbox(Monstermaxcoordview2);
			
			wait(1);
		}
		max_edit_a = 0;
	}
}

void max_b_edit()
{
	if(min_edit_a == 0)
	{
		max_edit_a = 1;
		spawn_edit();
	}
}
void min_b_edit()
{
	if(max_edit_a == 0)
	{
		min_edit_a = 1;
		spawn_edit();
	}
}

void selected_block()
{
	wait(-1);
	
		block_select = LBG_listbox_num_marked(Spanwn_block);
		ent_morphskin(spawn[block_befor],"spaw.tga");
		Monsteruidview.caption = str_for_int(NULL,monster_data[block_select].monster_uid);
		LBG_update_editbox(Monsteruidview);
		Monstermincoordview1.caption = str_for_int(NULL,monster_data[block_select].spawn_min_x);
		LBG_update_editbox(Monstermincoordview1);
		Monstermincoordview2.caption = str_for_int(NULL,monster_data[block_select].spawn_min_y);
		LBG_update_editbox(Monstermincoordview2);
		Monstermaxcoordview1.caption = str_for_int(NULL,monster_data[block_select].spawn_max_x);			
		LBG_update_editbox(Monstermaxcoordview1);	
		Monstermaxcoordview2.caption = str_for_int(NULL,monster_data[block_select].spawn_max_y);			
		LBG_update_editbox(Monstermaxcoordview2);	
		Monstermaxcountview.caption =  str_for_int(NULL,monster_data[block_select].monster_max_count);		
		LBG_update_editbox(Monstermaxcountview);	
		Monstermincountview.caption = str_for_int(NULL,monster_data[block_select].monster_respawn_count);		
		LBG_update_editbox(Monstermincountview);	
		Monsterrespawnview.caption = str_for_int(NULL,monster_data[block_select].monster_respawn_time);	
		LBG_update_editbox(Monsterrespawnview);
		if(monster_data[block_select].monster_type == 0){set(radiobutton_a1,CF_CHECKED);}
		else{set(radiobutton_a2,CF_CHECKED);}
		
		ent_morphskin(spawn[block_select],"spaw2.tga");
		
		block_befor = block_select;
}

void load_gui()
{
	win_bbmaps.bmap_titlebar_left = window_titlebar_left_tga;
	win_bbmaps.bmap_titlebar_middle = window_titlebar_middle_tga;
	win_bbmaps.bmap_titlebar_right = window_titlebar_right_tga;
	win_bbmaps.bmap_border_left = window_border_left_tga;
	win_bbmaps.bmap_border_right = window_border_right_tga;
	win_bbmaps.bmap_border_bottomleft = window_border_bottomleft_tga;
	win_bbmaps.bmap_border_bottom = window_border_bottom_tga;
	win_bbmaps.bmap_border_bottomright = window_border_bottomright_tga;
	
	win_cbmaps.bmap_topleft = window_content_topleft_tga;
	win_cbmaps.bmap_top = window_content_top_tga;
	win_cbmaps.bmap_topright = window_content_topright_tga;
	win_cbmaps.bmap_left = window_content_left_tga;
	win_cbmaps.bmap_right = window_content_right_tga;
	win_cbmaps.bmap_bottomleft = window_content_bottomleft_tga;
	win_cbmaps.bmap_bottom = window_content_bottom_tga;
	win_cbmaps.bmap_bottomright = window_content_bottomright_tga;
	win_cbmaps.bmap_center = window_content_center_tga;
	
	win_tbmaps.bmap_x_default = xbutton1_tga;
	win_tbmaps.bmap_x_over = xbutton2_tga;
	win_tbmaps.bmap_x_clicked = xbutton3_tga;
	win_tbmaps.bmap_max_default = maxbutton1_tga;
	win_tbmaps.bmap_max_over = maxbutton2_tga;
	win_tbmaps.bmap_max_clicked = maxbutton3_tga;
	win_tbmaps.bmap_res_default = resbutton1_tga;
	win_tbmaps.bmap_res_over = resbutton2_tga;
	win_tbmaps.bmap_res_clicked = resbutton3_tga;
	
	checkbox_bmaps.bmap_default = checkbox_default_tga;
	checkbox_bmaps.bmap_over = checkbox_over_tga;
	checkbox_bmaps.bmap_checked = checkbox_checked_tga;
	checkbox_bmaps.bmap_checked_over = checkbox_checked_over_tga;
	checkbox_bmaps.bmap_disabled = checkbox_disabled_tga;
	checkbox_bmaps.bmap_checked_disabled = checkbox_checked_disabled_tga;
	
	radiobutton_bmaps.bmap_default = radiobutton_default_tga;
	radiobutton_bmaps.bmap_over = radiobutton_over_tga;
	radiobutton_bmaps.bmap_checked = radiobutton_checked_tga;
	radiobutton_bmaps.bmap_checked_over = radiobutton_checked_over_tga;
	radiobutton_bmaps.bmap_disabled = radiobutton_disabled_tga;
	radiobutton_bmaps.bmap_checked_disabled = radiobutton_checked_disabled_tga;
	
	slider_bmaps.bmap_left = slider_left_tga;
	slider_bmaps.bmap_middle = slider_middle_tga;
	slider_bmaps.bmap_right = slider_right_tga;
	slider_bmaps.bmap_knob_default = slider_knob1_tga;
	slider_bmaps.bmap_knob_over = slider_knob2_tga;
	slider_bmaps.bmap_knob_clicked = slider_knob3_tga;
	
	progressbar_bmaps.bmap_pan_left = progressbar_left_tga;
	progressbar_bmaps.bmap_pan_middle = progressbar_middle_tga;
	progressbar_bmaps.bmap_pan_right = progressbar_right_tga;
	progressbar_bmaps.bmap_bar = progressbar_bar_tga;
	
	listbox_bmaps.bmap_topleft = listbox_topleft_tga;
	listbox_bmaps.bmap_top = listbox_top_tga;
	listbox_bmaps.bmap_topright = listbox_topright_tga;
	listbox_bmaps.bmap_left = listbox_left_tga;
	listbox_bmaps.bmap_right = listbox_right_tga;
	listbox_bmaps.bmap_bottomleft = listbox_bottomleft_tga;
	listbox_bmaps.bmap_bottom = listbox_bottom_tga;
	listbox_bmaps.bmap_bottomright = listbox_bottomright_tga;
	listbox_bmaps.bmap_center = listbox_center_tga;
	
	infobox_bmaps.bmap_topleft = infobox_topleft_tga;
	infobox_bmaps.bmap_top = infobox_top_tga;
	infobox_bmaps.bmap_topright = infobox_topright_tga;
	infobox_bmaps.bmap_left = infobox_left_tga;
	infobox_bmaps.bmap_right = infobox_right_tga;
	infobox_bmaps.bmap_bottomleft = infobox_bottomleft_tga;
	infobox_bmaps.bmap_bottom = infobox_bottom_tga;
	infobox_bmaps.bmap_bottomright = infobox_bottomright_tga;
	infobox_bmaps.bmap_center = infobox_center_tga;
	LBGUI_open();
	on_exit = LBGUI_close; 
	
	
		LBG_WINDOW* SMA_editor = LBG_create_window(NULL, 1420, 0, 480, 1050, 12, 1,"SMA Monster Spawns",&win_bbmaps,&win_cbmaps,&win_tbmaps,1, 0, WF_SHOW);	
		LBG_TEXT* Monster_block_txt = LBG_create_text(SMA_editor, 5, 20, Monster_block, TF_SHOW);
		Spanwn_block = LBG_create_listbox (SMA_editor, 200, 20, 192, 230, 16, 16, 160, 200, &listbox_bmaps, LF_SHOW | LF_UNSELECT);
		LBG_TEXT* monsteruidtxt = LBG_create_text(SMA_editor, 5, 303, Monster_uid, TF_SHOW);
		Monsteruidview = LBG_create_editbox(SMA_editor, 200, 300, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monsternametxt = LBG_create_text(SMA_editor, 5, 353, Monster_name, TF_SHOW);
		Monsternameview = LBG_create_editbox(SMA_editor, 200, 350, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monstertypetxt = LBG_create_text(SMA_editor, 5, 403 , Monster_type, TF_SHOW);
		Monstertypeview = LBG_create_editbox(SMA_editor, 200, 400, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monstermincoord = LBG_create_text(SMA_editor, 5, 453 , Monster_Cood_min, TF_SHOW);
		Monstermincoordview1 = LBG_create_editbox(SMA_editor, 200, 450, 70, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		Monstermincoordview2 = LBG_create_editbox(SMA_editor, 275, 450, 70, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		button1 = LBG_create_button(SMA_editor,350,450,5,4,"Edit",LBG_bbmaps(kl_button1_tga,kl_button2_tga,kl_button3_tga,kl_button4_tga,kl_button5_tga,kl_button6_tga),min_b_edit,BF_SHOW|BF_IGNOREKEYBOARD );
		LBG_TEXT* monstermaxcoord = LBG_create_text(SMA_editor, 5, 503 , Monster_Cood_max, TF_SHOW);
		Monstermaxcoordview1 = LBG_create_editbox(SMA_editor, 200, 500, 70, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		Monstermaxcoordview2 = LBG_create_editbox(SMA_editor, 275, 500, 70, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		button2 = LBG_create_button(SMA_editor,350,500,5,4,"Edit",LBG_bbmaps(kl_button1_tga,kl_button2_tga,kl_button3_tga,kl_button4_tga,kl_button5_tga,kl_button6_tga),max_b_edit,BF_SHOW|BF_IGNOREKEYBOARD );	
		LBG_TEXT* monstermaxcounttxt = LBG_create_text(SMA_editor, 5, 553 , Monster_Max_count, TF_SHOW);
		Monstermaxcountview = LBG_create_editbox(SMA_editor, 200, 550, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monstermincounttxt = LBG_create_text(SMA_editor, 5, 603 , Monster_Min_count, TF_SHOW);
		Monstermincountview = LBG_create_editbox(SMA_editor, 200, 600, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monsterrespawntimetxt = LBG_create_text(SMA_editor, 5, 653 , Monster_respawn_time, TF_SHOW);
		Monsterrespawnview = LBG_create_editbox(SMA_editor, 200, 650, 230, 16, 4, "", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), EF_SHOW|EF_READONLY);
		LBG_TEXT* monsterbosstxt = LBG_create_text(SMA_editor, 5, 703 , Monster_Boss, TF_SHOW);
		radiobutton_a1 = LBG_create_checkbox(SMA_editor,200, 703, 25, -4, "Yes",&radiobutton_bmaps, CF_SHOW | CF_RADIO);
		vec_set(radiobutton_a1->color_default,vector(0,192,0)); vec_set(radiobutton_a1->color_over,vector(0,212,0)); vec_set(radiobutton_a1->color_clicked,vector(0,192,0));
		radiobutton_a2 = LBG_create_checkbox(SMA_editor,290, 703, 25,-4, "No",&radiobutton_bmaps, CF_SHOW | CF_RADIO);
		vec_set(radiobutton_a2->color_default,vector(0,192,0)); vec_set(radiobutton_a2->color_over,vector(0,212,0)); vec_set(radiobutton_a2->color_clicked,vector(0,192,0));
		
		var counter = 0;
		Spanwn_block->tpos_x = 16; // This sets the text position of the items of this list relative to their positions
		Spanwn_block->tpos_y = 1;
		Spanwn_block->itemheight = 26; 
		Spanwn_block->bmaps_over.bmap_left = listitem_over_left_tga; // This determines the bitmap of the list items, when the mouse is over them.
		Spanwn_block->bmaps_over.bmap_middle = listitem_over_middle_tga;
		Spanwn_block->bmaps_over.bmap_right = listitem_over_right_tga;
		Spanwn_block->bmaps_marked.bmap_left = listitem_marked_left_tga; // This determines the bitmap of the list items, when they are selected.
		Spanwn_block->bmaps_marked.bmap_middle = listitem_marked_middle_tga;
		Spanwn_block->bmaps_marked.bmap_right = listitem_marked_right_tga;
		while(counter < smamb.monster_block_count )
		{
			if(counter == 0)
			{
				LBG_create_listitem(Spanwn_block, counter +1, str_for_num(NULL,counter),LIF_MARKED );
			}
			else
			{
				LBG_create_listitem(Spanwn_block, counter +1, str_for_num(NULL,counter),0 );
			}
			wait(1);
			counter +=1;
		}
		vec_set(Spanwn_block->color_over,vector(255,255,0));	// When the mouse over a list item, its text should turn cyan
		vec_set(Spanwn_block->color_marked,vector(0,255,255));	// When it's 
		LBG_VSCROLLBAR* listbox1_scrollbar = LBG_create_vscrollbar(Spanwn_block, LBG_vsbmaps (vscrollbar_top_tga,vscrollbar_middle_tga,vscrollbar_bottom_tga,vscrollbar_bar_tga), LBG_bbmaps(vscrollbar_up1_tga,vscrollbar_up2_tga,vscrollbar_up3_tga,vscrollbar_up1_tga,vscrollbar_up2_tga,vscrollbar_up1_tga), LBG_bbmaps(vscrollbar_down1_tga,vscrollbar_down2_tga,vscrollbar_down3_tga,vscrollbar_down1_tga,vscrollbar_down2_tga,vscrollbar_down1_tga), VSF_SHOW);
			
			LBG_update_listbox(Spanwn_block);
			on_mouse_left = selected_block;
		selected_block();
	
}



void create_sma_editor_window()
{
	editor_movement();
	Editor_modus = 1;
	 
	if(SMA_editor_ON_OFF == 0)
	{
		SMA_editor_ON_OFF = 1;
		
	}
	else
	{
		LBG_m (SMA_editor);
		SMA_editor_ON_OFF = 0;

	}
	

	
}

void create_obj_edit_window()
{
	
}






