core/menusystem: only send key presses to an active menu
This commit is contained in:
parent
a51eb1d64e
commit
e5e12714fb
1 changed files with 6 additions and 3 deletions
|
@ -34,9 +34,12 @@ function MenuSystem:update(dt)
|
|||
end
|
||||
|
||||
if self.menus[self.focusedMenu] ~= nil then
|
||||
for k,v in pairs(self.keys) do
|
||||
if self.keys[k].isPressed then
|
||||
self.menus[self.focusedMenu]:keyreleased(k)
|
||||
-- Only check buttons if the current focused menu is actually active
|
||||
if self.menus[self.focusedMenu].isActive then
|
||||
for k,v in pairs(self.keys) do
|
||||
if self.keys[k].isPressed then
|
||||
self.menus[self.focusedMenu]:keyreleased(k)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue