core/menusystem: add function to change menu
This commit is contained in:
parent
5cfe597618
commit
a27906d364
|
@ -62,6 +62,20 @@ function MainMenu:createBanner()
|
|||
|
||||
end
|
||||
|
||||
function MainMenu:selectMenu(menuID)
|
||||
self.menusystem:setAllMenuVisibility(false)
|
||||
self.menusystem:setAllMenuActivity(false)
|
||||
|
||||
if (self.menusystem.menus[menuID] == nil) then
|
||||
error("ERROR, menu " .. menuID .. " doesn't exist in scene menusystem")
|
||||
end
|
||||
|
||||
self.menusystem.menus[menuID].isVisible = true
|
||||
self.menusystem.menus[menuID].isActive = true
|
||||
|
||||
self.menusystem.menus[menuID]:getFocus()
|
||||
end
|
||||
|
||||
function MainMenu:update(dt)
|
||||
MainMenu.super.update(self, dt)
|
||||
lovebird.update()
|
||||
|
|
|
@ -22,7 +22,7 @@ function Widgets.Menu:new(menu, name, menuID)
|
|||
end
|
||||
|
||||
function Widgets.Menu:action()
|
||||
self.menusystem:selectMenu(self.menuID)
|
||||
self.scene:selectMenu(self.menuID)
|
||||
end
|
||||
|
||||
----
|
||||
|
|
Loading…
Reference in New Issue