examples/inventory: keep focus on main menu if the source is a pointer

This commit is contained in:
Kazhnuz 2019-04-07 12:43:11 +02:00
parent 3339e675d3
commit 2462b29ea3

View file

@ -93,8 +93,11 @@ function InventoryWidget:new(scene, menu, newmenu, fullname)
InventoryWidget.super.new(self, widgetmenu, font, fullname)
end
function InventoryWidget:action()
function InventoryWidget:action(source)
self.scene.menusystem:switchMenu(self.newmenu)
if (source == "pointer") then
self.scene.menusystem.menus["main"]:getFocus()
end
end
-- Scene widget :: switch scene