feat: add asset access to widgets
This commit is contained in:
parent
93bbf56047
commit
49509001ab
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue