local aktivm1 = -331          -- кнопка "фуллскрин" выделена
local vklm1 = -332          -- кнопка "фуллскрин" нажата
local optionsm1 = -333    
local aktivm2 = -334          -- кнопка "фуллскрин" выделена
local vklm2 = -335          -- кнопка "фуллскрин" нажата
local optionsm2 = -336               -- фон
local prinyatnazhimm = -337      -- кнопка "принять" нажата
local prinyatvklm = -138        -- кнопка "принять" выделена
local fullgalka1 = -139      -- галка на фуллскрине
local fullgalka2 = -140        -- галка на фуллскрине

function showMode()
  addstaticobjecttogame(optionsm1    ,"mode_win",282,136    ,"",0  ,0 ,489,365)
  addstaticobjecttogame(prinyatvklm  ,"menu_texture1",484,422    ,"",289,0  ,76 ,51 )
  addstaticobjecttogame(prinyatnazhimm  ,"menu_texture1",484,422    ,"",212,0  ,77 ,51 )
  addstaticobjecttogame(aktivm1      ,"menu_texture1",614,182+11     ,"",95 ,0  ,66 ,45 )
  addstaticobjecttogame(vklm1      ,"menu_texture1",614,193  ,"",28 ,0  ,67 ,46 )
  addstaticobjecttogame(fullgalka1    ,"menu_texture1",631,202,"",161,0  ,28 ,29 )  
  addstaticobjecttogame(aktivm2      ,"menu_texture1",612,302+11,"",95 ,0  ,66 ,45 )
  addstaticobjecttogame(vklm2      ,"menu_texture1",612,313    ,"",28 ,0  ,67 ,46 )
  addstaticobjecttogame(fullgalka2    ,"menu_texture1",631,322  ,"",161,0  ,28 ,29 )  
  
  speciale_action(4,optionsm1    )
  speciale_action(4,prinyatvklm  )
  speciale_action(4,prinyatnazhimm)
  speciale_action(4,aktivm1    )
  speciale_action(4,vklm1      )
  speciale_action(4,fullgalka1  )
  speciale_action(4,aktivm2    )  
  speciale_action(4,vklm2      )  
  speciale_action(4,fullgalka2  )  

  set_visible_object(prinyatnazhimm,false)
  set_visible_object(vklm1,false)
  set_visible_object(vklm2,false)

  set_visible_object(fullgalka1,true)
  set_visible_object(fullgalka2,false)
  set_visible_object(optionsm1,true)
  
  SetAlfaValue(prinyatvklm,0.01)
  SetAlfaValue(aktivm1,0.01)
  SetAlfaValue(aktivm2,0.01)
  
  OnMouseOver(prinyatvklm)
  OnMouseOver(aktivm1)
  OnMouseOver(aktivm2)
  StandartMode=true
  AdvancedMode=false    
  setInputFunction("ModeGameInput")
  local pressedButton = nil
  local dx = 0

end;

function closeMode()
    table.save(users,path)
    del_object_from_game(optionsm1    )
    del_object_from_game(prinyatvklm  )
    del_object_from_game(prinyatnazhimm)
    del_object_from_game(aktivm1    )
    del_object_from_game(vklm1      )
    del_object_from_game(fullgalka1  )
    del_object_from_game(optionsm2    )
    del_object_from_game(aktivm2    )
    del_object_from_game(vklm2      )
    del_object_from_game(fullgalka2  )  
    setInputFunction()
        setstateplay()
    
end

  function ModeGameInput(sender, obj_id,param2)

    -- ОК
    if threeStateButton(sender,obj_id,param2,prinyatvklm,prinyatnazhimm) then
      closeMode()
    end
    -- ОТМЕНА
    -- ФУЛЛСКРИН
    if threeStateButton(sender,obj_id,param2,aktivm1,vklm1) then
      set_visible_object(fullgalka1,true)
      set_visible_object(fullgalka2,false)
      StandartMode=true
      AdvancedMode=false
    end
    if threeStateButton(sender,obj_id,param2,aktivm2,vklm2) then
      set_visible_object(fullgalka1,false)
      set_visible_object(fullgalka2,true)
      StandartMode=false
      AdvancedMode=true
    end        
  end