diff --git a/sonic-boost.love/core/modules/menusystem/widgets/init.lua b/sonic-boost.love/core/modules/menusystem/widgets/init.lua index 7aa78d9..a09bfab 100644 --- a/sonic-boost.love/core/modules/menusystem/widgets/init.lua +++ b/sonic-boost.love/core/modules/menusystem/widgets/init.lua @@ -106,35 +106,6 @@ function BaseWidget:destroy() self.destroyed = true end -function drawWidget_selected(x, y, w, h) - love.graphics.setColor(0,0,0) - love.graphics.rectangle("fill", x, y, 4, 8) - love.graphics.rectangle("fill", x, y, 8, 4) - - love.graphics.rectangle("fill", x + w, y, -4, 8) - love.graphics.rectangle("fill", x + w, y, -8, 4) - - love.graphics.rectangle("fill", x, y + h, 4, -8) - love.graphics.rectangle("fill", x, y + h, 8, -4) - - love.graphics.rectangle("fill", x + w, y + h, -4, -8) - love.graphics.rectangle("fill", x + w, y + h, -8, -4) - - love.graphics.setColor(255,255,255) - love.graphics.rectangle("fill", x + 1, y + 1, 2, 6) - love.graphics.rectangle("fill", x + 1, y + 1, 6, 2) - - love.graphics.rectangle("fill", x + w - 1, y + 1, -2, 6) - love.graphics.rectangle("fill", x + w - 1, y + 1, -6, 2) - - love.graphics.rectangle("fill", x + 1, y + h - 1, 2, -6) - love.graphics.rectangle("fill", x + 1, y + h - 1, 6, -2) - - love.graphics.rectangle("fill", x + w - 1, y + h - 1, -2, -6) - love.graphics.rectangle("fill", x + w - 1, y + h - 1, -6, -2) - -end - Widget.Base = BaseWidget return Widget diff --git a/sonic-boost.love/core/modules/menusystem/widgets/utils.lua b/sonic-boost.love/core/modules/menusystem/widgets/utils.lua new file mode 100644 index 0000000..ab4a48c --- /dev/null +++ b/sonic-boost.love/core/modules/menusystem/widgets/utils.lua @@ -0,0 +1,34 @@ +local menuUtils = {} + +function menuUtils.drawCursor(x, y, w, h) + love.graphics.setColor(0,0,0) + + love.graphics.rectangle("fill", x, y, 4, 8) + love.graphics.rectangle("fill", x, y, 8, 4) + + love.graphics.rectangle("fill", x + w, y, -4, 8) + love.graphics.rectangle("fill", x + w, y, -8, 4) + + love.graphics.rectangle("fill", x, y + h, 4, -8) + love.graphics.rectangle("fill", x, y + h, 8, -4) + + love.graphics.rectangle("fill", x + w, y + h, -4, -8) + love.graphics.rectangle("fill", x + w, y + h, -8, -4) + + love.graphics.setColor(255,255,255) + + love.graphics.rectangle("fill", x + 1, y + 1, 2, 6) + love.graphics.rectangle("fill", x + 1, y + 1, 6, 2) + + love.graphics.rectangle("fill", x + w - 1, y + 1, -2, 6) + love.graphics.rectangle("fill", x + w - 1, y + 1, -6, 2) + + love.graphics.rectangle("fill", x + 1, y + h - 1, 2, -6) + love.graphics.rectangle("fill", x + 1, y + h - 1, 6, -2) + + love.graphics.rectangle("fill", x + w - 1, y + h - 1, -2, -6) + love.graphics.rectangle("fill", x + w - 1, y + h - 1, -6, -2) + +end + +return menuUtils