jaune = Color.new (255,255,0)
select = 1

file = io.open("Cfg/maj.cfg", "r")
majo = file:read()
file:close()
file = io.open("Cfg/passfix.cfg", "r")
pass = file:read()
file:close()
if pass == "true" then
select = 1
elseif pass ~= "true" or pass == "false" then
if majo == "0" then
select = 2
elseif majo == "3" then
select = 3 
elseif majo == "5" then
select = 4
end
end

while true do
screen:clear()
pad=Controls.read()
screen:blit(0,0,maj)

if select == 1 then
screen:clear()
screen:blit(0,0,maj)
screen:blit(130,117,fleche)
end

if select == 2 then
screen:clear()
screen:blit(0,0,maj)
screen:blit(130,140,fleche)
end

if select == 3 then
screen:clear()
screen:blit(0,0,maj)
screen:blit(130,163,fleche)
end

if select == 4 then
screen:clear()
screen:blit(0,0,maj)
screen:blit(130,186,fleche)
end

if pad:down() then
select = select + 1
end

if pad:up() then
select = select - 1
end

if select == 5 then
select = 1
end

if select == 0 then
select = 4
end

if pad:cross() then

if select == 1 then
file = io.open("Cfg/passfix.cfg", "w")
file:write("true")
file:close()
screen.flip()
screen.waitVblankStart(7)
dofile("menu.lua")
end

if select == 2 then
screen:blit(0,0,fond)
screen:print(150,140," Nous sommes desoles ",jaune)
screen:print(70,150,"    mais cette option n'est pas encore    ",jaune)
screen:print(170,160,"  fonctionnelle  ",jaune)
screen.flip()
screen.waitVblankStart(100)
dofile("menu.lua")
--file = io.open("Cfg/maj.cfg", "w")
--file:write("0")
--file:close()
--file = io.open("Cfg/passfix.cfg", "w")
--file:write("false")
--file:close()
end

if select == 3 then
file = io.open("Cfg/maj.cfg", "w")
file:write("3")
file:close()
file = io.open("Cfg/passfix.cfg", "w")
file:write("false")
file:close()
screen.flip()
screen.waitVblankStart(7)
dofile("menu.lua")
end

if select == 4 then
file = io.open("Cfg/maj.cfg", "w")
file:write("5")
file:close()
file = io.open("Cfg/passfix.cfg", "w")
file:write("false")
file:close()
screen.flip()
screen.waitVblankStart(7)
dofile("menu.lua")
end

end

if pad:start() then
screen.flip()
screen.waitVblankStart(7)
dofile("menu.lua")
end
if pad:circle() then
screen.flip()
screen.waitVblankStart(7)
dofile("option.lua")
end

screen.flip()
screen.waitVblankStart(7) 
end
