From 30af678488846a83025055ff8380515c30604112 Mon Sep 17 00:00:00 2001 From: Matthew Medal Date: Thu, 7 Mar 2024 17:55:55 -0800 Subject: [PATCH] Fix bug where Menu:activate() does not select Fixes [Issue 71](https://github.com/NobleRobot/NobleEngine/issues/71). Because `Menu:select()` requires that the menu `isActive()` (or has been `__forced`), we ensure that this is true in `Menu:activate()`. --- modules/Noble.Menu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Noble.Menu.lua b/modules/Noble.Menu.lua index b875fc2..fff9b5d 100644 --- a/modules/Noble.Menu.lua +++ b/modules/Noble.Menu.lua @@ -308,8 +308,8 @@ function Noble.Menu.new(__activate, __alignment, __localized, __color, __padding -- local menu = Noble.Menu.new(false) -- menu:activate() function menu:activate() - self:select(self.currentItemNumber) active = true + self:select(self.currentItemNumber) end --- Deactivate this menu. -- This deselects all menu items, and disables this menu's @{selectPrevious|selectPrevious}, @{selectNext|selectNext}, and @{click|click} methods.