From 3b78d300cafb382387310fc86fe3e5e938e6a038 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Thu, 19 May 2016 14:28:18 -0700 Subject: Folders can now be opened in the files browser other tweaks --- files.lua | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 6 deletions(-) (limited to 'files.lua') diff --git a/files.lua b/files.lua index 0f8048a..105d7db 100644 --- a/files.lua +++ b/files.lua @@ -5,24 +5,79 @@ function drawFiles() love.graphics.setColor(250, 250, 250) love.graphics.rectangle("fill", 8, 74, win[3].w-17, win[3].h-108) love.graphics.rectangle("fill", 8, 31, win[3].w-17, 34) - drawUpBox(9, 32, 38, 32, 2) + if file.back == false then + drawUpBox(9, 32, 38, 32, 2) + else + drawDownBox(9, 32, 38, 32, 2) + end love.graphics.setColor(255, 255, 255) love.graphics.draw(internet.back, 11, 32) love.graphics.setColor(colors.font.dark) - love.graphics.print("/User/", 70, 44) + love.graphics.print(file.title, 70, 44) for i=1,#files do if files[i].type == 0 then files[i].x = 40 - files[i].y = 80 - if files[i].x*i < 300 then + if i < 6 then + files[i].y = 80 files[i].x = (i*80)-43 + elseif i >= 6 then + files[i].y = 150 + files[i].x = ((i-5)*80)-43 end love.graphics.setFont(pixeloperators) love.graphics.setColor(256,256,256) love.graphics.draw(icons[32].file,files[i].x,files[i].y,0,1.5,1.5) - love.graphics.setColor(colors.font.dark) - love.graphics.printf(files[i].name,files[i].x-13,files[i].y+48,75,"center") + if files[i].hl == true then + love.graphics.setColor(0,0,120) + love.graphics.rectangle("fill", files[i].x-13,files[i].y+48,75,20) + love.graphics.setColor(colors.font.light) + love.graphics.printf(files[i].name,files[i].x-13,files[i].y+48,75,"center") + else + love.graphics.setColor(colors.font.dark) + love.graphics.printf(files[i].name,files[i].x-13,files[i].y+48,75,"center") + end love.graphics.setFont(pressstart) end end end +function updateFiles() + for i=1,#files do + if mouseClick(win[3].x+files[i].x,win[3].y+files[i].y,80,70) == true + and layer[1] == 3 and file.p == false then + file.p = true + if files[i].hl == false then + for i=1,#files do + files[i].hl = false + end + files[i].hl = true + win[3].update = true + elseif files[i].hl == true then + win[3].update = true + file.title = "/User/" .. files[i].name .. "/" + if f.home == files then + if i == 4 then + files = f.pictures + elseif i == 1 then + files = f.documents + elseif i == 2 then + files = f.downloads + elseif i == 3 then + files = f.music + elseif i == 5 then + files = f.videos + end + return + end + end + end + end + if mouseClick(win[3].x+9,win[3].y+32,38,32) == true and layer[1] == 3 and files ~= f.home then + files = f.home + file.title = "/User/" + win[3].update = true + file.back = true + elseif file.back == true and sys.mouse.p.p == false then + file.back = false + win[3].update = true + end +end -- cgit