add_tree_leaf("Root","DAII",-1,-1)
function gameinput()
end
------Имя игрока----------------------------------------------------------------------------------
UserPos={}
UserPos["posX"]=875.0;
UserPos["posY"]=92.0;
------------положение курсора---------------
CaretPos={}
CaretPos["posX"]=607.0;
CaretPos["posY"]=283.0;
------Имя игрока----------------------------------------------------------------------------------
PlayerPlace={}
PlayerPlace["posX"]=930.0;
PlayerPlace["posY"]=87.0;
------Выделение текущего профайла-----------------------------------------------------------------------------------------------------
SelectLine ={}
SelectLine["img"]="buttons";
SelectLine["posX"]=35.0; --35
SelectLine["posY"]=0.0;
SelectLine["posXimg"]=55.0;
SelectLine["posYimg"]=984.0;
SelectLine["width"]=24.0;
SelectLine["height"]=24.0;
------Окошко профайла-----------------------------------------------------------------------------------------------------
ProfWND ={}
ProfWND["img"]="buttons";
ProfWND["posX"]=230.0;      
ProfWND["posY"]=64.0;          
ProfWND["posXimg"]=31.0;       
ProfWND["posYimg"]=351.0;       
ProfWND["width"]=481.0;         
ProfWND["height"]=521.0;      
------Кнопка Ок профайла-----------------------------------------------------------------------------------------------------
ProfBOK ={}
ProfBOK["img"]="buttons";
ProfBOK["posX"]=531.0;
ProfBOK["posY"]=477.0;
ProfBOK["posXimg"]=916.0;
ProfBOK["posYimg"]=4.0;
ProfBOK["width"]=100.0;
ProfBOK["height"]=44.0;
------Выделение Кнопки Ок профайла-----------------------------------------------------------------------------------------------------
ProfBOKSelect ={}
ProfBOKSelect["img"]="buttons";
ProfBOKSelect["posX"]  =532.0;
ProfBOKSelect["posY"]  =478.0;
ProfBOKSelect["posXimg"]=918.0;
ProfBOKSelect["posYimg"]=55.0;
ProfBOKSelect["width"]  =100.0;
ProfBOKSelect["height"]  =44.0;
------Кнопка Новый игрок-----------------------------------------------------------------------------------------------------
ProfBNew ={}
ProfBNew["img"]="buttons";
ProfBNew["posX"]  =293.0;
ProfBNew["posY"]  =477.0;
ProfBNew["posXimg"]=917.0;
ProfBNew["posYimg"]=238.0;
ProfBNew["width"]  =100.0;
ProfBNew["height"]  =44.0;
------Выделение кнопки новый профайл-----------------------------------------------------------------------------------------------------
ProfBNewSelect ={}
ProfBNewSelect["img"]="buttons";
ProfBNewSelect["posX"]   =293.0;
ProfBNewSelect["posY"]   =477.0;
ProfBNewSelect["posXimg"]=917.0;
ProfBNewSelect["posYimg"]=292.0;
ProfBNewSelect["width"]   =100.0;
ProfBNewSelect["height"] =44.0;
------Кнопка удалить-----------------------------------------------------------------------------------------------------
ProfBDel ={}
ProfBDel["img"]="buttons";
ProfBDel["posX"]   =413.0;
ProfBDel["posY"]   =477.0;
ProfBDel["posXimg"]=912.0;
ProfBDel["posYimg"]=130.0;
ProfBDel["width"]  =100.0;
ProfBDel["height"] =44.0;
------Выделение кнопки удалить-----------------------------------------------------------------------------------------------------
ProfBDelSelect ={}
ProfBDelSelect["img"]="buttons";
ProfBDelSelect["posX"]   =413.0;
ProfBDelSelect["posY"]   =477.0;
ProfBDelSelect["posXimg"]=917.0;
ProfBDelSelect["posYimg"]=184.0;
ProfBDelSelect["width"]  =100.0;
ProfBDelSelect["height"] =44.0;
-------Окно ввода профайла----------------------------------------------------------------------------------------------------
ProfEnterName ={}
ProfEnterName["img"]="buttons";
ProfEnterName["posX"]   =360.0; --360
ProfEnterName["posY"]   =150.0;
ProfEnterName["posXimg"]=216.0;
ProfEnterName["posYimg"]=0.0;
ProfEnterName["width"]  =690.0;
ProfEnterName["height"] =348.0;
-------Кнопка ок ввода профайла----------------------------------------------------------------------------------------------------
ProfEnterBOk ={}
ProfEnterBOk["img"]="delete";
ProfEnterBOk["posX"]   =866.0;
ProfEnterBOk["posY"]   =360.0;
ProfEnterBOk["posXimg"]=678.0;
ProfEnterBOk["posYimg"]=942.0;
ProfEnterBOk["width"]  =62.0;
ProfEnterBOk["height"] =70.0;
--------Выделение кнопки Ок профайла---------------------------------------------------------------------------------------------------
ProfEnterBOkSelect ={}
ProfEnterBOkSelect["img"]="buttons";
ProfEnterBOkSelect["posX"]   =866.0;
ProfEnterBOkSelect["posY"]   =360.0;
ProfEnterBOkSelect["posXimg"]=792.0;
ProfEnterBOkSelect["posYimg"]=935.0;
ProfEnterBOkSelect["width"]  =62.0;
ProfEnterBOkSelect["height"] =70.0;
---------Мигающий курсор ввода имени--------------------------------------------------------------------------------------------------
ProfBlinkKursor ={}
ProfBlinkKursor["img"]="buttons";
ProfBlinkKursor["posX"]   =0.0;
ProfBlinkKursor["posY"]   =0.0;
ProfBlinkKursor["posXimg"]=108.0;
ProfBlinkKursor["posYimg"]=987.0;
ProfBlinkKursor["width"]  =3.0;
ProfBlinkKursor["height"] =  25.0;
---------Окошко удаления профайла--------------------------------------------------------------------------------------------------
ProfDelete ={}
ProfDelete["img"]="delete";
ProfDelete["posX"]   =390.0; --420
ProfDelete["posY"]   =172.0;
ProfDelete["posXimg"]=0.0;
ProfDelete["posYimg"]=0.0;
ProfDelete["width"]  =536.0;
ProfDelete["height"] =278.0;
------Кнопка Ок удаления профайла-------------------------------------------------------------------------------------------------
ProfDeleteOK ={}
ProfDeleteOK["img"]="delete";
ProfDeleteOK["posX"]   =839.0;
ProfDeleteOK["posY"]   =354.0;
ProfDeleteOK["posXimg"]=347.0;
ProfDeleteOK["posYimg"]=282.0;
ProfDeleteOK["width"]  =62.0;
ProfDeleteOK["height"] =70.0;
------Выделение кнопки ок удаления-------------------------------------------------------------------------------------------------
ProfDeleteOKSelect ={}
ProfDeleteOKSelect["img"]="delete";
ProfDeleteOKSelect["posX"]   =839.0;
ProfDeleteOKSelect["posY"]   =354.0;
ProfDeleteOKSelect["posXimg"]=458.0;
ProfDeleteOKSelect["posYimg"]=286.0;
ProfDeleteOKSelect["width"]  =62.0;
ProfDeleteOKSelect["height"] =70.0;
----------Кнопка отмена окна удалить-------------------------------------------------------------------------------------------------
ProfDeleteCancel ={}
ProfDeleteCancel["img"]="delete";
ProfDeleteCancel["posX"]   =784.0;
ProfDeleteCancel["posY"]   =216.0;
ProfDeleteCancel["posXimg"]=172.0;
ProfDeleteCancel["posYimg"]=286.0;
ProfDeleteCancel["width"]  =126.0;
ProfDeleteCancel["height"] =62.0;
---------Выделание кнопки отмена удаления--------------------------------------------------------------------------------------------------
ProfDeleteCancelSelect ={}
ProfDeleteCancelSelect["img"]="delete";
ProfDeleteCancelSelect["posX"]   =784.0;
ProfDeleteCancelSelect["posY"]   =216.0;
ProfDeleteCancelSelect["posXimg"]=23.0;
ProfDeleteCancelSelect["posYimg"]=286.0;
ProfDeleteCancelSelect["width"]  =126.0;
ProfDeleteCancelSelect["height"] =62.0;
------Кнопка профиля-----------------------------------------------------------------------------------------------------
Profile ={}
Profile["img"]="buttons";
Profile["posX"]=780.0;
Profile["posY"]=10.0;
Profile["posXimg"]=751.0;
Profile["posYimg"]=804.0;
Profile["width"]=247.0;
Profile["height"]=111.0;
------Настройка вывода профилей-----------------------------------------------------------------------------------------------------
ProfilesSetup ={}
ProfilesSetup["img"]="buttons";
ProfilesSetup["posX"]=614.0;
ProfilesSetup["posY"]=209.0;
ProfilesSetup["maxrecord"]=10;
ProfilesSetup["widthrecords"]=253.0;
ProfilesSetup["heightrecords"]=28.0;
ProfilesSetup["DownSound"]="menu_click";
ProfilesSetup["OverSound"]="menu_on";
ProfilesSetup["UpSound"]="menu_press";
------Выделение текущего профайла-----------------------------------------------------------------------------------------------------
SelectLine ={}
SelectLine["img"]="buttons";
SelectLine["posX"]=35.0;
SelectLine["posY"]=0.0;
SelectLine["posXimg"]=428.0;
SelectLine["posYimg"]=975.0;
SelectLine["width"]=265.0;
SelectLine["height"]=38.0;
------Окошко профайла-----------------------------------------------------------------------------------------------------
ProfWND ={}
ProfWND["img"]="buttons";
ProfWND["posX"]=556.0;      
ProfWND["posY"]=147.0;          
ProfWND["posXimg"]=395.0;       
ProfWND["posYimg"]=545.0;       
ProfWND["width"]=313.0;         
ProfWND["height"]=324.0;        
------Кнопка Ок профайла-----------------------------------------------------------------------------------------------------
ProfBOK ={}
ProfBOK["img"]="buttons";
ProfBOK["posX"]=762.0;
ProfBOK["posY"]=427.0;
ProfBOK["posXimg"]=601.0;
ProfBOK["posYimg"]=825.0;
ProfBOK["width"]=74.0;
ProfBOK["height"]=22.0;
------Выделение Кнопки Ок профайла-----------------------------------------------------------------------------------------------------
ProfBOKSelect ={}
ProfBOKSelect["img"]="buttons";
ProfBOKSelect["posX"]  =757.0;
ProfBOKSelect["posY"]  =423.0;
ProfBOKSelect["posXimg"]=422.0;
ProfBOKSelect["posYimg"]=878.0;
ProfBOKSelect["width"]  =80.0;
ProfBOKSelect["height"]  =30.0;
------Кнопка Новый игрок-----------------------------------------------------------------------------------------------------
ProfBNew ={}
ProfBNew["img"]="buttons";
ProfBNew["posX"]  =591.0;
ProfBNew["posY"]  =427.0;
ProfBNew["posXimg"]=430.0;
ProfBNew["posYimg"]=825.0;
ProfBNew["width"]  =74.0;
ProfBNew["height"]  =22.0;
------Выделение кнопки новый профайл-----------------------------------------------------------------------------------------------------
ProfBNewSelect ={}
ProfBNewSelect["img"]="buttons";
ProfBNewSelect["posX"]   =587.0;
ProfBNewSelect["posY"]   =423.0;
ProfBNewSelect["posXimg"]=422.0;
ProfBNewSelect["posYimg"]=878.0;
ProfBNewSelect["width"]   =80.0;
ProfBNewSelect["height"] =30.0;
------Кнопка удалить-----------------------------------------------------------------------------------------------------
ProfBDel ={}
ProfBDel["img"]="buttons";
ProfBDel["posX"]   =676.0;
ProfBDel["posY"]   =427.0;
ProfBDel["posXimg"]=515.0;
ProfBDel["posYimg"]=825.0;
ProfBDel["width"]  =74.0;
ProfBDel["height"] =22.0;
------Выделение кнопки удалить-----------------------------------------------------------------------------------------------------
ProfBDelSelect ={}
ProfBDelSelect["img"]="buttons";
ProfBDelSelect["posX"]   =672.0;
ProfBDelSelect["posY"]   =423.0;
ProfBDelSelect["posXimg"]=422.0;
ProfBDelSelect["posYimg"]=878.0;
ProfBDelSelect["width"]  =80.0;
ProfBDelSelect["height"] =30.0;
-------Окно ввода профайла----------------------------------------------------------------------------------------------------
ProfEnterName ={}
ProfEnterName["img"]="buttons";
ProfEnterName["posX"]   =461.0;
ProfEnterName["posY"]   =195.0;
ProfEnterName["posXimg"]=135.0;
ProfEnterName["posYimg"]=0.0;
ProfEnterName["width"]  =333.0;
ProfEnterName["height"] =175.0;
-------Кнопка ок ввода профайла----------------------------------------------------------------------------------------------------
ProfEnterBOk ={}
ProfEnterBOk["img"]="buttons";
ProfEnterBOk["posX"]   =586.0;
ProfEnterBOk["posY"]   =325.0;
ProfEnterBOk["posXimg"]=260.0;
ProfEnterBOk["posYimg"]=130.0;
ProfEnterBOk["width"]  =77.0;
ProfEnterBOk["height"] =36.0;
--------Выделение кнопки Ок профайла---------------------------------------------------------------------------------------------------
ProfEnterBOkSelect ={}
ProfEnterBOkSelect["img"]="buttons";
ProfEnterBOkSelect["posX"]   =562.0;
ProfEnterBOkSelect["posY"]   =306.0;
ProfEnterBOkSelect["posXimg"]=477.0;
ProfEnterBOkSelect["posYimg"]=181.0;
ProfEnterBOkSelect["width"]  =106.0;
ProfEnterBOkSelect["height"] =42.0;
---------Мигающий курсор ввода имени--------------------------------------------------------------------------------------------------
ProfBlinkKursor ={}
ProfBlinkKursor["img"]="buttons";
ProfBlinkKursor["posX"]   =0.0;
ProfBlinkKursor["posY"]   =0.0;
ProfBlinkKursor["posXimg"]=633.0;
ProfBlinkKursor["posYimg"]=924.0;
ProfBlinkKursor["width"]  =3.0;
ProfBlinkKursor["height"] =  25.0;
---------Окошко удаления профайла--------------------------------------------------------------------------------------------------
ProfDelete ={}
ProfDelete["img"]="buttons";
ProfDelete["posX"]   =461.0;
ProfDelete["posY"]   =195.0;
ProfDelete["posXimg"]=480.0;
ProfDelete["posYimg"]=0.0;
ProfDelete["width"]  =317.0;
ProfDelete["height"] =164.0;
----------Кнопка Ок удаления профайла-------------------------------------------------------------------------------------------------
ProfDeleteOK ={}
ProfDeleteOK["img"]="buttons";
ProfDeleteOK["posX"]   =637.0;
ProfDeleteOK["posY"]   =315.0;
ProfDeleteOK["posXimg"]=656.0;
ProfDeleteOK["posYimg"]=120.0;
ProfDeleteOK["width"]  =99.0;
ProfDeleteOK["height"] =30.0;
----------Выделение кнопки ок удаления-------------------------------------------------------------------------------------------------
ProfDeleteOKSelect ={}
ProfDeleteOKSelect["img"]="buttons";
ProfDeleteOKSelect["posX"]   =616.0;
ProfDeleteOKSelect["posY"]   =308.0;
ProfDeleteOKSelect["posXimg"]=477.0;
ProfDeleteOKSelect["posYimg"]=181.0;
ProfDeleteOKSelect["width"]  =106.0;
ProfDeleteOKSelect["height"] =42.0;
----------Кнопка отмена окна удалить-------------------------------------------------------------------------------------------------
ProfDeleteCancel ={}
ProfDeleteCancel["img"]="buttons";
ProfDeleteCancel["posX"]   =498.0;
ProfDeleteCancel["posY"]   =315.0;
ProfDeleteCancel["posXimg"]=518.0;
ProfDeleteCancel["posYimg"]=120.0;
ProfDeleteCancel["width"]  =99.0;
ProfDeleteCancel["height"] =30.0;
---------Выделание кнопки отмена удаления--------------------------------------------------------------------------------------------------
ProfDeleteCancelSelect ={}
ProfDeleteCancelSelect["img"]="buttons";
ProfDeleteCancelSelect["posX"]   =480.0;
ProfDeleteCancelSelect["posY"]   =308.0;
ProfDeleteCancelSelect["posXimg"]=477.0;
ProfDeleteCancelSelect["posYimg"]=181.0;
ProfDeleteCancelSelect["width"]  =106.0;
ProfDeleteCancelSelect["height"] =42.0;
-----------------------------------------------------------------------------------------------------------
UserPos={}
UserPos["posX"]=551.0;
UserPos["posY"]=257.0;
playfile(".\\sound\\Music_2.ogg",true,true);
initfont();

loadresource("data\\main-menu.jpg","main",1);
-- loadresource("data\\mb.png","button",3);
--loadresource("data\\window.png","window",11);
-- loadresource("data\\pr_s.png","pr_s",12);
loadresource("data\\buttons.png","buttons",13);

loadresource("data\\developers.jpg","developers",14);
loadresource("data\\exit.png","exit",15);
loadresource("data\\options.png","options",16);

addpagetomenu(1);
addimagetomenu(1,"main",0,0);

addBattontomenupage(1,1,141,290,0,531,186,82,0,0);--играть
addSelectImage(1,1,135,291,190,531,191,82,"buttons");

addBattontomenupage(1,3,125,372,0,611,278,85,0,0);--настройки
addSelectImage(1,3,126,366,0,692,277,95,"buttons");

addBattontomenupage(1,2,152,447,0,800,160,66,0,0);--выход
addSelectImage(1,2,148,436,158,789,175,86,"buttons");



addpagetomenu(2);
addimagetomenu(2,"main",0,0);
addimagetomenu(2,"options",229,143,0,0,512,538);--Подложка меню настроек

--addimagetomenu(2,"buttons",266,197,715,545,243,25);--Надпись "Звуковые эффекты"
--addimagetomenu(2,"buttons",266,267,715,596,196,25);--Надпись "Громкость Музыки"
--addimagetomenu(2,"buttons",330,341,715,571,243,25);--Надпись "На весь экран"

--addimagetomenu(2,"buttons",276,233,398,322,230,20);--полоска "Звуковые эффекты"
--addimagetomenu(2,"buttons",276,305,398,322,230,20);--полоска "Громкость Музыки"

addSlidertomenupage(2,2,366,300,247,0,129,40,53,0,0);--шарик "Звуковые эффекты"
addSlidertomenupage(2,3,366,397,247,0,129,40,53,0,0);--шарик "Громкость Музыки"
addBattontomenupage(2,4,636,522,50,143,46,32);--кнопка ОК
addSelectImage(2,4,628,508, 42,130,61,61,"buttons",false);
addCheckBox(2,5,510,525,    0,177,  40,35,   0,35);--шарик полно экранный режим

addBattontomenupage(2,6,388,600,55,262,189,47);--кнопка Разработчики
addSelectImage(2,6,380,592, 46,197,204,59,"buttons",false);

addpagetomenu(3);
addimagetomenu(3,"developers",0,0,0,0,1024,768);--Подложка меню настроек          
addBattontomenupage(3,1,873,653,910,216,77,36);--кнопка ОК
addSelectImage(3,1,873,653, 911,383,77,36,"buttons",false);

addpagetomenu(4);
addimagetomenu(4,"main",0,0);
addimagetomenu(4,"exit",173,146,0,0,512,323);--Подложка меню настроек
  
addBattontomenupage(4,2,459,408,885,480,116,34);--кнопка ОК  
addSelectImage(4,2,451,401, 885,426,133,48,"buttons",false);
addBattontomenupage(4,1,272,408,760,480,116,34);--кнопка Cancel
addSelectImage(4,1,264,401,885,426,133,48,"buttons",false);

set_menu_page(1);
addPresReactionToBatton(1,1,"tomap");
addPresReactionToBatton(1,2,"_exit");
addPresReactionToBatton(1,3,"options");

addPresReactionToBatton(2,2,"musuk");
addPresReactionToBatton(2,3,"effect");
addPresReactionToBatton(2,4,"tomain");
addPresReactionToBatton(2,5,"fullscrean");
addPresReactionToBatton(2,6,"showdevelopers");

addPresReactionToBatton(3,1,"BackToOption");

addPresReactionToBatton(4,1,"BackToMain");
addPresReactionToBatton(4,2,"Exit");


function C_Callaps(obj_id)
  ColorCallaps(obj_id,100,5);
end
function setmenupage(page)
playeffect("chpok");
  set_menu_page(page);
end

function tomap()
playeffect("chpok");
  loadprofile();
  setstateplay();
end

function newgame()
playeffect("chpok");
  setstateplay();
end

function _exit()
playeffect("chpok");
  set_menu_page(4);
end

function options()
playeffect("chpok");
  set_menu_page(2);
end

function musuk(val)
  setmusucvalue(val);
end
function effect(val)
  seteffectvalue(val);
end
function tomain()
playeffect("chpok");
  set_menu_page(1);
end
function fullscrean()
playeffect("chpok");
  tofullscrean();
end
function showdevelopers()
playeffect("chpok");
  set_menu_page(3);
end
function BackToOption()
playeffect("chpok");
  set_menu_page(2);
end
------------4--------------
function BackToMain()
playeffect("chpok");
  set_menu_page(1);
end
function Exit()
playeffect("chpok");
  savesetings();
  exitgame();
end
---------------------------
CaretPos={}
CaretPos["posX"]=551.0;
CaretPos["posY"]=257.0;
