dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");


location={}
location["kabinet"] = true
location["kabinet"] = {}
location["kabinet"]["id"] = 2
location["kabinet"]["sub_id"] = 0
location["photolab"] = true
location["photolab"] = {}
location["photolab"]["id"] = 2
location["photolab"]["sub_id"] = 1


function LoadingLevel(param)
    SetAlfaValue(501,0)
	SetAlfaValue(503,0)
	SLevel=param;
return;end;
function LevelComplete()
	flags.levelcomplete=true;
	setcurentleaf("photolab",2,1);
	DeleteElement("gr",101);
	DeleteElement("gr",102);
	DeleteElement("gr",103);
			    flags.levelcomplete=true;
				ShowMenu(false);
				DarkScreen(true);
end;

function StartLevel()
	setcurentleaf("kabinet",2,0);
	    Set_Cursor(54,2);
	setcurentleaf("photolab",2,1);	
		AddParticleToObject(54,"Svet3",0,0);		
		MoveEmiter("Svet3",76,600);	
		MoveEmiter("water",126,391);					
		MoveEmiter("probirka_b",202,283);		
		MoveEmiter("probirka_y",365,183);		
		MoveEmiter("banka",400,189);
		StartEmiter("banka");	
		StartEmiter("water");	
		StartEmiter("probirka_b");
		StartEmiter("probirka_y");	
		AddParticleToObject(21,"Svet1",0,0);
		AddParticleToObject(19,"Svet",0,0);
		AddParticleToObject(14,"Svet2",0,0);
		MoveEmiter("Svet1",317,415);
		MoveEmiter("Svet",589,446);
		MoveEmiter("Svet2",430,420);			
		if not flags.inv then
			StartEmiter("Svet3");		
		end;
		if flags.inv then
		if not flags.minicomplete1 then
		--	Set_Cursor(19,4)
			StartEmiter("Svet2");	
		end;		
		if not flags.minicomplete2 then
			StartEmiter("Svet");
		end;
		if not flags.minicomplete then		
			StartEmiter("Svet1");						
		end;
		end;
end;

frame=0;

flags={};

flags["whole_darkness"]=false;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["minicomplete2"]=false;

flags["minitext1"]=false;
flags["minitext2"]=false;
flags["minitext3"]=false;

flags["minirun1"]=false;
flags["minirun2"]=false;
flags["minirun3"]=false;

flags["inv"]=false;
flags["caseopen"]=false;
flags["levelcomplete"]=false;

flags["skip"]=false;
flags["comics"]=false;
flags["HintCount"]=5;

add_tree_leaf("Root","kabinet",2,0);-- Добавляет лист в дерево 

SetCurrentRM("menu");
    addstaticobjecttogame(877777777,"menubuttons",63,622,"",60,0,61,61);
	AddSheet(1002,"re","red_b",63,622,61,61,"",128,640,650,115,15,5,7,7,0,59,877777777);
SetCurrentRM("main");
	dofile("./data/2/0/res.lua");
add_tree_leaf("Root","photolab",2,1);	
SetCurrentRM("menu");
	addstaticobjecttogame(877777777,"menubuttons",63,622,"",60,0,61,61);
	AddSheet(1002,"re","red_b",63,622,61,61,"",128,640,650,115,15,5,7,7,0,59,877777777);
SetCurrentRM("main");
dofile("./data/2/1/res.lua");	
loadresource("data\\photoaparat.png","photoaparat",112121212);
AddImgToBook("photoaparat",838,580);
AddHints()
ShowMenu(false);





setcurentleaf("kabinet",2,0);
add_free_leaf("comics1",2,51);
dofile("./data/2/51/res.lua");
set_satelite_leaf("kabinet");
dofile("data\\2\\51\\level.lua");
playfile(".\\sound\\Music_2.ogg",true,true);
