From 82cf59588a00941940113256a429db6d53e9d5cd Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 27 Nov 2020 16:02:54 +0100 Subject: [PATCH] chore: port menu to rect --- birb/modules/menusystem/parent.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/birb/modules/menusystem/parent.lua b/birb/modules/menusystem/parent.lua index 050f0a8..f1aeb71 100644 --- a/birb/modules/menusystem/parent.lua +++ b/birb/modules/menusystem/parent.lua @@ -21,7 +21,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] -local Menu = Object:extend() +local Rect = require "birb.objects.2D.rect" + +local Menu = Rect:extend() local function updateWidgetByOrder(a, b) if a.order ~= b.order then @@ -38,10 +40,7 @@ function Menu:new(menusystem, name, x, y, w, h) self.menusystem = menusystem self.name = name - self.x = x - self.y = y - self.w = w - self.h = h + Menu.super.new(self, x, y, w, h) self.widget = {} self.widget.list = {} @@ -137,10 +136,7 @@ function Menu:clear() end function Menu:resize(x,y,w,h) - self.x = x - self.y = y - self.w = w - self.h = h + self:set(x,y,w,h) self:updateWidgetSize() end