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,12 +34,15 @@ function MenuSystem:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.menus[self.focusedMenu] ~= nil then
|
if self.menus[self.focusedMenu] ~= nil then
|
||||||
|
-- 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
|
for k,v in pairs(self.keys) do
|
||||||
if self.keys[k].isPressed then
|
if self.keys[k].isPressed then
|
||||||
self.menus[self.focusedMenu]:keyreleased(k)
|
self.menus[self.focusedMenu]:keyreleased(k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue