From 49509001ab313bdb316d4f4e5ea57d534c8eb821 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 5 Dec 2020 09:23:46 +0100 Subject: [PATCH] feat: add asset access to widgets --- birb/modules/menusystem/menus/widgets/base.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/birb/modules/menusystem/menus/widgets/base.lua b/birb/modules/menusystem/menus/widgets/base.lua index 67f845e..0ff1212 100644 --- a/birb/modules/menusystem/menus/widgets/base.lua +++ b/birb/modules/menusystem/menus/widgets/base.lua @@ -27,6 +27,7 @@ local BaseWidget = Object:extend() function BaseWidget:new(menuName) self.menu = self:getMenuByName(menuName) + self.assets = self:getAssets() self.destroyed = false self.selectable = false @@ -51,6 +52,11 @@ function BaseWidget:getGui() return scene.menusystem end +function BaseWidget:getAssets() + local scene = core.scenemanager.currentScene + return scene.assets +end + function BaseWidget:register() self.creationID = self.menu:getWidgetNumber() self.menu:addWidget(self)