dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");
location={}
location["daus_vhod"] = true
location["daus_vhod"] = {}
location["daus_vhod"]["id"] = 19
location["daus_vhod"]["sub_id"] = 0
location["daus_bar"] = true
location["daus_bar"] = {}
location["daus_bar"]["id"] = 19
location["daus_bar"]["sub_id"] = 1
function LevelComplete()
  if not flags.photo then
    AddElement("gr",127);
    MoveObjectToTree(127);
  end;    
  if not flags.display then  
    AddElement("gr",128);
    MoveObjectToTree(128);
  end;    
  DeleteElement("gr",225);
  DeleteElement("gr",126);
  DeleteElement("gr",125);
  DeleteElement("gr",117);
  flags.levelcomplete=true;
    whole_darkness=false;
  DarkScreen(true);
  ShowMenu(false)
end;
function LoadingLevel(param)
if flags.levelcomplete then
  delete_tree_leaf("Root","daus_vhod");
  delete_tree_leaf("Root","daus_bar"); 
  setnextlavel(20);
  loadlavel();
return; end;
SetAlfaValue(503,0);
     SLevel=param;
return;end;
function LoadNextLevel()
  delete_tree_leaf("Root","daus_vhod");
  delete_tree_leaf("Root","daus_bar");
  setnextlavel(20);
  loadlavel();
end;

flags={};
flags["comx"]=false;
flags["comx1"]=false;
flags["HintCount"]=5;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["minicomplete20"]=false;
flags["loc1"] = false;
flags["loc2"] = false;
flags["firstloc2"]=false;
flags["all1"]=false;
flags["all2"]=false;
flags["all2"]=false;
flags["photo"]=false;
flags["display"]=false;
flags["levelcomplete"]= false;
flags["first"]= false;
flags["first1"]= false;
flags["nohints"]=false;
flags["mess"]= true;
skip= false;

add_tree_leaf("Root","daus_vhod",19,0);

  addstaticobjecttogame(877777777,"buttons",114,625,"",60,0,61,61);
  SetCurrentRM("menu");
  AddSheet(1002,"re","red_b",103,656,37,41,"",99,657,650,80,92,21,5,5,0,59,877777777,nil,"buttonsY");
  SetCurrentRM("main");
  ShowMenu(true);
loadresource("data\\photoaparat.png","photoaparat",2000029);
loadresource("data\\animationMENU3.png","menuAn",2000030);
AddImgToBook("photoaparat",821,637);
AddHints()
dofile("./data/19/0/res.lua");
 UpdateStack();
  add_tree_leaf("Root","daus_bar",19,1);-- Добавляет лист в дерево 
  addstaticobjecttogame(877777777,"buttons",114,625,"",60,0,61,61);
  SetCurrentRM("menu");
  AddSheet(1002,"re","red_b",103,656,37,41,"",99,657,650,80,92,21,5,5,0,59,877777777,nil,"buttonsY");
  SetCurrentRM("main");
  dofile("./data/19/1/res.lua");
   UpdateStack();
setcurentleaf("daus_vhod",19,0);
WaitRender()
flags.comx= true

ShowMenu(false);
function StartLevel()
  DarkScreen(false);
  SetCurrentRM("menu");
    AddImgToBook("photoaparat",821,637);
    AddHints()
  SetCurrentRM("main");
  ShowMenu(true);
setcurentleaf("daus_vhod",19,0);
  AddParticleToObject(11,"pu4ok1",199,472);
  MoveEmiter("pu4ok1",199,472);
  if (not flags.minicomplete20) then
    StartEmiter("pu4ok1"); 
  end;
setcurentleaf("daus_bar",19,1);
  AddParticleToObject(44,"pu4ok",345,396);
  MoveEmiter("pu4ok",345,396);
    AddParticleToObject(58,"moneti",554,152);
    MoveEmiter("moneti",554,152);
    if (not flags.minicomplete47)  then
      StartEmiter("pu4ok"); 
    end;
    if (not flags.minicomplete22)  then
      StartEmiter("moneti"); 
    end;
end
playfile(".\\sound\\game_theme2.ogg",true,true);