download archive.lst game list

master
fanta 3 years ago
parent 980c313624
commit 2abb4729ec

@ -1,14 +1,14 @@
local http = require("socket.http")
-- VARIABLES -- VARIABLES
pathWget="/usr/bin/wget" sysUser = os.getenv( "HOME" )
pathDosbox = "/usr/bin/dosbox" pathDosbox = "/usr/bin/dosbox"
pathFDD = sysUser.."/.fdd"
urlGameList="http://fanta.56k.es/fdd/fdd_server/archive.lst"
screenSizeW = love.graphics.getWidth() screenSizeW = love.graphics.getWidth()
screenSizeH = love.graphics.getHeight() screenSizeH = love.graphics.getHeight()
love.window.setTitle( "FDD GUI" )
love.window.setTitle( "FDD" )
font = love.graphics.newFont("res/fonts/old_computer_st.ttf", 12) font = love.graphics.newFont("res/fonts/old_computer_st.ttf", 12)
monitor = {} monitor = {}
monitor.img = love.graphics.newImage("res/imgs/disquete.png") monitor.img = love.graphics.newImage("res/imgs/disquete.png")
monitor.width = 200 monitor.width = 200
@ -25,7 +25,6 @@ end
function check_dependencies() function check_dependencies()
file_check(pathDosbox) file_check(pathDosbox)
file_check(pathWget)
end end
function draw_floppyDiskName(floppydisk_name) function draw_floppyDiskName(floppydisk_name)
@ -34,12 +33,20 @@ function draw_floppyDiskName(floppydisk_name)
love.graphics.printf(floppydisk_name,(screenSizeW/2)-50,(screenSizeH/2)-3,400,left) love.graphics.printf(floppydisk_name,(screenSizeW/2)-50,(screenSizeH/2)-3,400,left)
end end
function download_gameList(url_gameList)
os.execute("mkdir -p "..pathFDD)
local body, code = http.request(url_gameList)
local f = assert(io.open(pathFDD.."/archive.lst", "wb"))
f:write(body)
f:close()
end
-- FUNCIONES LOVE -- FUNCIONES LOVE
function love.load() function love.load()
--os.execute("dosbox")
check_dependencies() check_dependencies()
download_gameList(urlGameList)
end end
function love.update() function love.update()

Loading…
Cancel
Save