dofile("script\\gamemenu.lua");
dofile("script\\lib.lua");
set_inpun_fun("gameinput");
location={}
location["gallery"] = true
location["gallery"] = {}
location["gallery"]["id"] = 3
location["gallery"]["sub_id"] = 0
function LevelComplete()
  DeleteElement("gr",1656);
  DeleteElement("gr",108);
  DeleteElement("gr",111);
  DeleteElement("gr",656);
  DeleteElement("gr",53);
  speciale_action(2,500);
  flags.levelcomplete=true;
    whole_darkness=false;
  DarkScreen(true);
  ShowMenu(false)
end;
function LoadingLevel(param)
if flags.levelcomplete then
  delete_tree_leaf("Root","gallery");-- Добавляет лист в дерево 
  setnextlavel(4);
  loadlavel();
return; end;
SetAlfaValue(503,0);
     SLevel=param;
return;end;
flags={};
flags["comx"]=false;
flags["comx1"]=false;
flags["minicomplete"]=false;
flags["minicomplete1"]=false;
flags["portrait"]=false;
flags["spray"]=false;
flags["cleanportrait"]=false;
flags["object"]=false;
flags["skip"]=false;
flags["gubka"]=false;
flags["levelcomplete"]= false;
flags["nohints"]=false;
flags["HintCount"]=5;
skip=false;
frame=0;


  add_tree_leaf("Root","gallery",3,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");

dofile("./data/3/0/res.lua");
loadresource("data\\photoaparat.png","photoaparat",2000029);
loadresource("data\\animationMENU3.png","menuAn",2000030);
AddImgToBook("photoaparat",821,637);
AddHints()
setcurentleaf("gallery",3,0);
SwitchToSheet("re");
ShowMenu(false);
frame=0;
WaitRender()
flags.comx= true
      
ShowMenu(false);

playfile(".\\sound\\game_theme2.ogg",true,true);

function StartLevel()
AddParticleToObject(45,"Svet",427,529);
MoveEmiter("Svet",427,529);
AddParticleToObject(21,"portret",410,338);
MoveEmiter("portret",410,338);
if not flags.minicomplete27 then
StartEmiter("Svet"); 
end;
if not flags.minicomplete19 then
StartEmiter("portret"); 
end;
  DarkScreen(false);
    SetCurrentRM("menu");
    AddImgToBook("photoaparat",821,637);
    AddHints()
  SetCurrentRM("main");
    ShowMenu(true);
end
