Noir=Color.new(0,0,0)
USB=false
Options=false
dofile("wall/options.ini")
dofile("SYSTEM/dev.lua")
dofile("img/curseurs/options.ini")
dofile("img/curseurs/sensibilite.ini")
dofile("wall/"..wall_choisis)
souris = Image.load("IMG/curseurs/"..curseur_choisis)
help=false
while true do
pad = Controls.read()
Android:Fond()
if bureau == 1 then
  Widget:Horloge(50,50)
elseif bureau == 2 then
  Widget:Google()
elseif bureau == 3 then
  Widget:Batterie()
end
Android:Menu()
Android:Notif()
Android:Barre()

-- Seulement pour les devs

if dev == true then
dev_string = "actif"
screen:print(1,1,"desk:"..bureau)
screen:print(1,11,"x:"..curx)
screen:drawLine(curx,0,curx,272,blanc)
screen:print(1,21,"y:"..cury)
screen:drawLine(0,cury,480,cury,blanc)
if pad:square() then
System.runeboot("ms0:/psp/game/htmlide/eboot.pbp")
end
if pad:circle() then
screen:save("ms0:/psp/game/screen.png")
end
elseif dev == false then
dev_string = "inactif"
end

-- Fin

if curx==479 and menu_ok == false and Options == false then
  bureau=bureau+1
  curx=1
elseif bureau>=4 then
  bureau=1
end

if curx==0 and menu_ok == false and Options == false then
  bureau=bureau-1
  curx=478
elseif bureau<=0 then
  bureau=3
end

if pad:triangle() and not oldpad:triangle() and help==false then
  help=true
elseif pad:triangle() and not oldpad:triangle() and help==true then
  help=false
end
if help == true then
 System.message("Aide\n"..
                "Pour changer de bureau, plaquez le curseur a un des cotes de l'ecran.\n"..
                "Les menus s'ouvrent par un clic.\n"..
                "Les menu rapides s'activent par la touche start.\n",0)
 help = false
end

if pad:start() and not oldpad:start() and Options==false then
  Options=true
elseif pad:start() and not oldpad:start() and Options==true then
  Options=false
end
if Options==true then
  Android:Options()
end

if y_notif == 26 then
 Android:Date(5,18)
end

Android:Souris()
oldpad = pad
screen.flip()
screen.waitVblankStart()
end
