From a3cf5bef63b9ecd4db7d68de98f95c1a48a84626 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 09:29:13 +0200 Subject: [PATCH] fix: make widget item colorable --- sonic-radiance.love/core/modules/menusystem/listbox.lua | 2 +- sonic-radiance.love/core/modules/menusystem/widgets/init.lua | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sonic-radiance.love/core/modules/menusystem/listbox.lua b/sonic-radiance.love/core/modules/menusystem/listbox.lua index b8e47e7..10e4f85 100644 --- a/sonic-radiance.love/core/modules/menusystem/listbox.lua +++ b/sonic-radiance.love/core/modules/menusystem/listbox.lua @@ -126,10 +126,10 @@ function ListBox:draw() local widgety = self.y for i,v in ipairs(self.widget.list) do if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then - v:draw(self.x, widgety, self.w, self.widget.h) if self.widget.selected == i and self:haveFocus() == true then v:drawSelected(self.x, widgety, self.w, self.widget.h) else + utils.graphics.resetColor() v:draw(self.x, widgety, self.w, self.widget.h) end widgety = widgety + self.widget.h diff --git a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua index 9c02e5a..15ab5b2 100644 --- a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua +++ b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua @@ -91,7 +91,6 @@ end function BaseWidget:draw(x, y) if self.canvas.texture ~= nil then - utils.graphics.resetColor() love.graphics.draw(self.canvas.texture, x, y) end end