modules/menusystem: link a menusystem to a scene

This commit is contained in:
Kazhnuz 2019-04-20 17:54:01 +02:00
parent 946b446844
commit faa12d4ff7
2 changed files with 6 additions and 2 deletions

View file

@ -38,7 +38,8 @@ MenuSystem.Widget = require(cwd .. "widgets")
-- INIT FUNCTIONS
-- Initialize and configure the menu controller
function MenuSystem:new()
function MenuSystem:new(scene)
self.scene = scene
self.menus = {}
self.focusedMenu = ""
self.isActive = true
@ -140,6 +141,9 @@ function MenuSystem:removeDestroyedMenus()
end
end
-- SOUND FUNCTIONS
-- Add sounds to every menus
-- UPDATE FUNCTIONS
-- Update the menus of the menusystem

View file

@ -37,7 +37,7 @@ function Scene:new()
self.mouse.x, self.mouse.y = core.screen:getMousePosition()
self.assets = Assets()
self.menusystem = MenuSystem()
self.menusystem = MenuSystem(self)
self.sources = core.input:getSources()
self.inputLocked = false