diff options
| -rw-r--r-- | antivirus.lua | 27 | ||||
| -rw-r--r-- | window.lua | 6 |
2 files changed, 33 insertions, 0 deletions
diff --git a/antivirus.lua b/antivirus.lua index 690a4bb..a518494 100644 --- a/antivirus.lua +++ b/antivirus.lua @@ -1,2 +1,29 @@ function drawAntivirus() + love.graphics.setColor(150,150,150) + love.graphics.setLineWidth(2) + love.graphics.rectangle("line", 49, 110, 100, 19) + love.graphics.rectangle("line", 10, 40, 180, 30) + love.graphics.setColor(70,70,70) + love.graphics.print("SCAN NOW", 51, 116) + love.graphics.print(antivirus.status, 10, 77) + love.graphics.setColor(0,0,120) + love.graphics.rectangle("fill", 13, 43, antivirus.prog, 24) +end +function updateAntivirus() + if (sys.mouse.p.p == true and win[4].hover == true and antivirus.scanning == false + and sys.mouse.p.x >= win[4].x+49 and sys.mouse.p.x <= win[4].x+49+100 + and sys.mouse.p.y >= win[4].y+110 and sys.mouse.p.y <= win[4].y+110+19) then + antivirus.scanning = true + antivirus.prog = 0 + end + if antivirus.scanning == true then + antivirus.prog = antivirus.prog + math.random(0,0.5,2,10,1,20,0.1,0.2) + win[4].update = true + antivirus.status = "Scanning: " .. math.floor(antivirus.prog/174*100) .. "%" + end + if antivirus.prog >= 174 then + antivirus.prog = 174 + antivirus.scanning = false + antivirus.status = "0 Viruses Found" + end end @@ -21,6 +21,9 @@ function drawWindow(id) love.graphics.line(0+win[id].w-37, 0+13, 0+win[id].w-37+10, 0+13) love.graphics.setColor(220, 220, 220) love.graphics.print(win[id].title, 0+6, 0+9) --Title + if id == 4 then + drawAntivirus(win[id].x, win[id].y, win[id].hover) + end love.graphics.setCanvas() win[id].update = false end @@ -109,6 +112,9 @@ function drawWindow(id) if win[id].miny < 0 then win[id].miny = 0 end + if id == 4 then + updateAntivirus() + end love.graphics.setColor(255,255,255) end function orderWindows() |
