From 2462b29ea322b34e4ad9c3720873df9558956693 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 7 Apr 2019 12:43:11 +0200 Subject: [PATCH] examples/inventory: keep focus on main menu if the source is a pointer --- examples/menus/inventory/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/menus/inventory/init.lua b/examples/menus/inventory/init.lua index 0a50ef5..10dcb99 100644 --- a/examples/menus/inventory/init.lua +++ b/examples/menus/inventory/init.lua @@ -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