font = Font.load("Geek a byte 2.ttf")
font:setPixelSizes(25,30)


Bild3 = Image.load("1background.jpg")


rot = Color.new(255,0,0)
blau = Color.new(0,0,255)
weiss = Color.new(255,255,255)


battr = System.powerGetBatteryLifePercent()

current = 1
oldpad = Controls.read()
while true do
screen:clear()
pad = Controls.read()
screen:blit(0,0,Bild3,true)

    
    screen:fontPrint(font,140,80,"Activate USB",blau)
	screen:fontPrint(font,140,110,"Deactivate USB",blau)
	screen:fontPrint(font,140,140,"(UMD)Activate USB",blau)
	screen:fontPrint(font,140,200,"Mainmenu",blau)
	
	
	if current == 1 then
    screen:fontPrint(font,140,80,"Activate USB",rot)
    end
    if current == 2 then
    screen:fontPrint(font,140,110,"Deactivate USB",rot)
    end
	if current == 3 then
	screen:fontPrint(font,140,140,"(UMD)Activate USB",rot)
	end
	if current == 4 then 
	screen:fontPrint(font,140,200,"Mainmenu",rot)
	end
	

	if pad:up() and oldpad:up() ~= pad:up() then
    current = current - 1
    end
    if pad:down() and oldpad:down() ~= pad:down() then
    current = current + 1
    end

	
     -- IF-Befehle --
     
	
    if pad:cross() and current == 1 then
    System.usbDiskModeActivate()
    end
    
	if pad:cross() and current == 2 then
    System.usbDiskModeDeactivate()
    end
	
	if pad:cross() and current == 3 then
	System.usbDiskModeActivate()
    System.usbDevUMD()
    System.usbDiskModeActivate()
	end
	
    if pad:cross() and current == 4 then
	Bild3 = nil
    dofile("LUATool.lua") 	
    end 
	
    if current == 5 then
    current = 1
    end
    if current == 0 then
    current = 4
    end



screen:print(300, 10, "Batterie-Status:", weiss)
screen:print(440, 10, battr, rot)
screen:print(460, 10, "%", weiss)


collectgarbage()
screen.waitVblankStart()
screen.flip()
end