|
|
@ -11,14 +11,14 @@ screenSizeW = love.graphics.getWidth()
|
|
|
|
screenSizeH = love.graphics.getHeight()
|
|
|
|
screenSizeH = love.graphics.getHeight()
|
|
|
|
|
|
|
|
|
|
|
|
love.window.setTitle( "FDD GUI" )
|
|
|
|
love.window.setTitle( "FDD GUI" )
|
|
|
|
font = love.graphics.newFont("res/fonts/old_computer_st.ttf", 12)
|
|
|
|
font = love.graphics.newFont("res/fonts/COMPUTERRobot.ttf", 20)
|
|
|
|
|
|
|
|
|
|
|
|
monitor = {}
|
|
|
|
disquete = {}
|
|
|
|
monitor.img = love.graphics.newImage("res/imgs/disquete.png")
|
|
|
|
disquete.img = love.graphics.newImage("res/imgs/disquete.png")
|
|
|
|
monitor.width = 200
|
|
|
|
disquete.width = 200
|
|
|
|
monitor.height = 200
|
|
|
|
disquete.height = 200
|
|
|
|
monitor.x = (screenSizeW/2)-(monitor.width/2)
|
|
|
|
disquete.x = (screenSizeW/2)-(disquete.width/2)
|
|
|
|
monitor.y = (screenSizeH/2)-(monitor.height/2)
|
|
|
|
disquete.y = (screenSizeH/2)-(disquete.height/2)
|
|
|
|
|
|
|
|
|
|
|
|
rkey = {}
|
|
|
|
rkey = {}
|
|
|
|
rkey.img = love.graphics.newImage("res/imgs/keyboard_key_r.png")
|
|
|
|
rkey.img = love.graphics.newImage("res/imgs/keyboard_key_r.png")
|
|
|
@ -47,9 +47,9 @@ function check_dependencies()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function draw_floppyDiskName(floppydisk_name)
|
|
|
|
function draw_floppyDiskName(floppydisk_name)
|
|
|
|
love.graphics.setColor(255,255,255)
|
|
|
|
love.graphics.setColor(2550,255,255)
|
|
|
|
love.graphics.setFont(font)
|
|
|
|
love.graphics.setFont(font)
|
|
|
|
love.graphics.printf(floppydisk_name,(screenSizeW/2)-50,(screenSizeH/2)-3,400,left)
|
|
|
|
love.graphics.printf(floppydisk_name,335,292,400,left)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function download_gameList(url_gameList)
|
|
|
|
function download_gameList(url_gameList)
|
|
|
@ -82,16 +82,34 @@ function download_listGames(file)
|
|
|
|
return arr
|
|
|
|
return arr
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function check_numberGames()
|
|
|
|
function load_games()
|
|
|
|
os.execute("ls -1 /home/fanta/.fdd/ | wc -l")
|
|
|
|
n=0
|
|
|
|
|
|
|
|
game = {}
|
|
|
|
|
|
|
|
for l in io.lines(pathFDD.."/archive.lst") do
|
|
|
|
|
|
|
|
n=n+1
|
|
|
|
|
|
|
|
g = split_string(l, ";")
|
|
|
|
|
|
|
|
table.insert(game, g[2])
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
max=n
|
|
|
|
|
|
|
|
print(n.." games")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function next_game()
|
|
|
|
|
|
|
|
if n==max then
|
|
|
|
|
|
|
|
n=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
n=n+1
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
print("ch game: "..game[n])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- FUNCIONES LOVE
|
|
|
|
-- FUNCIONES LOVE
|
|
|
|
|
|
|
|
|
|
|
|
function love.load()
|
|
|
|
function love.load()
|
|
|
|
check_dependencies()
|
|
|
|
check_dependencies()
|
|
|
|
download_gameList(urlGameList)
|
|
|
|
download_gameList(urlGameList)
|
|
|
|
check_numberGames()
|
|
|
|
load_games()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function love.update()
|
|
|
|
function love.update()
|
|
|
@ -105,8 +123,8 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function love.draw()
|
|
|
|
function love.draw()
|
|
|
|
love.graphics.setBackgroundColor( (170/255), (100/255), (70/255) )
|
|
|
|
love.graphics.setBackgroundColor( (170/255), (100/255), (70/255) )
|
|
|
|
love.graphics.draw(monitor.img,monitor.x,monitor.y)
|
|
|
|
love.graphics.draw(disquete.img,disquete.x,disquete.y)
|
|
|
|
draw_floppyDiskName("Darkseed")
|
|
|
|
draw_floppyDiskName(game[n])
|
|
|
|
love.graphics.draw(rkey.img, rkey.x, rkey.y)
|
|
|
|
love.graphics.draw(rkey.img, rkey.x, rkey.y)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -118,7 +136,18 @@ function love.keypressed(key)
|
|
|
|
|
|
|
|
|
|
|
|
if key == "r" then
|
|
|
|
if key == "r" then
|
|
|
|
print("re-check game repository")
|
|
|
|
print("re-check game repository")
|
|
|
|
download_listGames("/home/fanta/.fdd/archive.lst")
|
|
|
|
download_listGames(pathFDD.."/archive.lst")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if key == "right" then
|
|
|
|
|
|
|
|
next_game()
|
|
|
|
|
|
|
|
--download_listGames(pathFDD.."/archive.lst")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if key == "return" then
|
|
|
|
|
|
|
|
print("run !")
|
|
|
|
|
|
|
|
os.execute("tar xfvz "..pathFDD.."/"..game[n].." -C "..pathFDD.."/")
|
|
|
|
|
|
|
|
os.execute("name=$(echo "..game[n].."|cut -d . -f 1); bash "..pathFDD.."/$name/dos-*")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|