From 517625861535f76f1dcb992fff76d23fe4239f7c Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 7 Apr 2018 18:29:50 +0200 Subject: Replaced deprecated filesystem functions --- config/menus/host.lua | 2 +- config/menus/select.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/menus/host.lua b/config/menus/host.lua index 2b5fac5..102c4c3 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -32,7 +32,7 @@ function loadConfigs (dir, process) local items, icons = {}, {} for _,file in pairs(love.filesystem.getDirectoryItems(dir)) do local path = string.format("%s/%s", dir, file) - if love.filesystem.isFile(path) and file ~= "readme.md" then + if love.filesystem.getInfo(path).type == "file" and file ~= "readme.md" then local item = love.filesystem.load(path)() if isAvailable(item) then if process then diff --git a/config/menus/select.lua b/config/menus/select.lua index 9f0ed9b..6534004 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -36,7 +36,7 @@ function loadConfigs (dir, process) local items, icons = {}, {} for _,file in pairs(love.filesystem.getDirectoryItems(dir)) do local path = string.format("%s/%s", dir, file) - if love.filesystem.isFile(path) and file ~= "readme.md" then + if love.filesystem.getInfo(path).type == "file" and file ~= "readme.md" then local item = love.filesystem.load(path)() if isAvailable(item) then if process then -- cgit v1.1 From 6cef97b6e9ba6878607b1fff08e42ca19b79914f Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 7 Apr 2018 18:53:31 +0200 Subject: Hopefully all uses of setColor now use values in <0,1> range --- config/menus/main.lua | 2 +- config/menus/pause.lua | 2 +- config/menus/select.lua | 2 +- config/menus/settings.lua | 8 ++++---- config/menus/win.lua | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/menus/main.lua b/config/menus/main.lua index ae2cef2..87dca94 100644 --- a/config/menus/main.lua +++ b/config/menus/main.lua @@ -58,7 +58,7 @@ return { :setPosition(width/2, 15) :set("draw", function (self, scale) local x,y = self:getPosition() - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1, 1, 1, 1) love.graphics.setFont(Bold) love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35) end) diff --git a/config/menus/pause.lua b/config/menus/pause.lua index 60aa2fc..d0b5777 100644 --- a/config/menus/pause.lua +++ b/config/menus/pause.lua @@ -9,7 +9,7 @@ local bx = width/2-29 return { Element(menu) :set("draw", function (self, scale) - love.graphics.setColor(0, 0, 0, 110) + love.graphics.setColor(0, 0, 0, .45) local width, height = love.graphics.getWidth(), love.graphics.getHeight() love.graphics.rectangle("fill", 0, 0, width, height) end) diff --git a/config/menus/select.lua b/config/menus/select.lua index 6534004..df14ad7 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -128,7 +128,7 @@ return { if self.the_final_countdown ~= 9 then local x,y = self:getPosition() local countdown = math.max(1, math.ceil(self.the_final_countdown)) - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1, 1, 1, 1) love.graphics.setFont(Font) love.graphics.print("Autostart in:", (x-16)*scale, (y+10)*scale, 0, scale, scale) love.graphics.setFont(Bold) diff --git a/config/menus/settings.lua b/config/menus/settings.lua index 7102bea..94b8e7a 100644 --- a/config/menus/settings.lua +++ b/config/menus/settings.lua @@ -16,13 +16,13 @@ local dimmer = Element(menu) :set("previousControl", "") -- it actually means key that was set as this control PREVIOUSLY :set("draw", function (self, scale) if self.visible then - love.graphics.setColor(0, 0, 0, 210) + love.graphics.setColor(0, 0, 0, .8) love.graphics.rectangle("fill",0,0,width*getRealScale(),height*getRealScale()) - love.graphics.setColor(120, 255, 120, 255) + love.graphics.setColor(.5, 1, .5, 1) love.graphics.printf("Press new key for: \n> " .. self.currentControl .. " <", (width/2-110)*scale, (height/2-4)*scale, 220, "center", 0, scale, scale) - love.graphics.setColor(120, 120, 120, 255) + love.graphics.setColor(.5, .5, .5, 1) love.graphics.printf("Old: " .. self.previousControl .. "", (width/2-110)*scale, (height/2+16)*scale, 220, "center", 0, scale, scale) - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1, 1, 1, 1) end end) diff --git a/config/menus/win.lua b/config/menus/win.lua index f7163dd..ee56aeb 100644 --- a/config/menus/win.lua +++ b/config/menus/win.lua @@ -10,7 +10,7 @@ return { :setPosition(width/2, 18) :set("draw", function (self, scale) local x,y = self:getPosition() - love.graphics.setColor(255, 255, 255, 255) + love.graphics.setColor(1, 1, 1, 1) love.graphics.printf("ROFL, NOW KILL YOURSELF", x*scale, y*scale, 160, "center", 0, scale, scale, 80, 3) end) :set("focus", function () return true end) -- cgit v1.1