
adj_img={}
settings_title={"Ajustes de Usuarios","Ajustes de Diseņo", "Ajustes de Controles", "Ajustes de Sonido", "Ajustes de Sistema"}

colorA=color.new(255,0,0)
colorB=color.new(0,0,255)

brigh=50

opc_adj={}
opc_adj[1]={x=120,y=60,w=50,h=50}
opc_adj[2]={x=360,y=60,w=50,h=50}
opc_adj[3]={x=120,y=200,w=50,h=50}
opc_adj[4]={x=360,y=200,w=50,h=50}
opc_adj[5]={x=215,y=130,w=50,h=50}

function panel_control()
liberar(13)

if files.exists("ms0:/PSP/GAME/PSPEXPLORER v2/FX/imagenes/escritorio/10.png") then
	maxifondo=8
else
	maxifondo=9
end

while true do
controls.read()
img_escritorio[fondo_escritorio]:blend(0,0,200)


for i=1,5 do
	if col(p,opc_adj[i]) then
		if controls.press("cross") then
			ajuste_panel(i)
		end
		screen.print(opc_adj[i].x+25,opc_adj[i].y-10,settings_title[i],0.7,blanco,0,"center")
		adj_img[i]:blit(opc_adj[i].x,opc_adj[i].y)
	else
		screen.print(opc_adj[i].x+25,opc_adj[i].y-10,settings_title[i],0.6,verde,0,"center")
		adj_img[i]:blit(opc_adj[i].x,opc_adj[i].y)
	end
end

puntero()
if controls.press("start") then sistema() end
screen.flip()
end
end

function ajuste_panel(menu)
actual=0
x=-100
if menu==2 then especial=true else especial=false end
while true do
controls.read()
img_escritorio[fondo_escritorio]:blend(0,0,200)

if x<240 then
	x=x+3
end

screen.print(x,65,settings_title[menu],0.7,blanco,0,"center")
adj_img[menu]:blit(x-25,75)
for i=1,#settings[menu] do
	if col(p,{x=100,y=115+i*20,w=280,h=15}) then 
		if controls.press("cross") and x>=240 then ajustar(menu,i) end
		screen.print(x,115+i*20,settings[menu][i],0.6,verde,0,"center")
		if especial then
			if i==5 then screen.print(x-screen.textwidth(settings[menu][i],0.6)/2+10,115+i*20,"[X]",0.6,colorA,0) end
			if i==6 then screen.print(x-screen.textwidth(settings[menu][i],0.6)/2+10,115+i*20,"[X]",0.6,colorB,0) end
		end
	else
		screen.print(x,115+i*20,settings[menu][i],0.5,blanco,0,"center")
		if especial then
			if i==5 then screen.print(x-screen.textwidth(settings[menu][i],0.5)/2+10,115+i*20,"[X]",0.5,colorA,0) end
			if i==6 then screen.print(x-screen.textwidth(settings[menu][i],0.5)/2+10,115+i*20,"[X]",0.5,colorB,0) end
		end
	end
	
end

if controls.press("circle") then return end
puntero()
if controls.press("start") then sistema() end
screen.flip()
end
end

