Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- position = 1
- limitInf = 1
- White = color.new(255,255,255)
- DeepSkyBlue = color.new(0,191,255)
- Red = color.new(255,0,0)
- ForestGreen = color.new(34,139,34)
- Black = color.new(0,0,0)
- workDir = files.list("ms0:/")
- function changeMsc()
- Music = Music + 1
- sndObj= sound.load(listMsc[Music])
- sndObj:play()
- end
- function playMusic()
- if files.ext(workDir[position].name) == "mp3" or files.ext(workDir[position].name) == "wav" then
- if controls.press("cross") then
- sound.play()
- end
- if controls.press("l") then
- changeMsc(-1)
- end
- if controls.press("r") then
- changeMsc(1)
- end
- if controls.press("start") then
- sound.pause()
- end
- if controls.press("square") then
- sound.stop()
- sound.free()
- end
- end
- end
- function exeBackups()
- if controls.press("cross") and files.ext(workDir[position].name) == "iso" then
- os.runiso(workDir[position].name)
- end
- if controls.press("cross") and files.ext(workDir[position].name) == "cso" then
- os.runiso(workDir[position].name)
- end
- end
- function options()
- x=15
- y=20
- site=workDir[position].name
- for i= limitInf, #workDir do
- if y >= 0 and y <= 272 then --Esto, hace que solo se imprima entre esas coordenadas
- if position == i then
- screen.print(x,y,files.nopath(workDir[i].name),0.6,Black,White)
- else
- screen.print(x,y,files.nopath(workDir[i].name),0.6,White,0x0)
- end
- y = y+13
- if y >= 260 then y = 277 end --Esto, hace que si supera un limite imprima fuera
- end
- end
- end
- function navegator()
- if controls.press("down") and position ~= #workDir then
- position = position+1
- if position > 19 then limitInf = limitInf+1 end
- end
- if controls.press("up") and position > 1 then
- position = position-1
- if position > 18 then limitInf = limitInf-1 end
- end
- end
- function go()
- if workDir[position].directory then
- position = 1
- limitInf = 1
- workDir = files.list(site)
- end
- end
- function backforward()
- position = 1
- limitInf = 1
- workDir = files.list(files.nofile(files.nofile(site)))
- end
- while true do
- controls.read()
- playMusic()
- exeBackups()
- navegator()
- draw.gradrect(0,0,480,272,DeepSkyBlue,Red,Black,ForestGreen)
- options()
- if controls.press("cross") then
- go()
- end
- if controls.press("triangle") then
- backforward()
- end
- screen.flip()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement