From 28beee9c412059109c5a45cf463c72ccbb766e47 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 11 Feb 2019 22:39:18 +0100 Subject: [PATCH] core/menusystem: only count click if menu is currently active --- sonic-boost.love/core/modules/menusystem/init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sonic-boost.love/core/modules/menusystem/init.lua b/sonic-boost.love/core/modules/menusystem/init.lua index 435b0cd..d882d5d 100644 --- a/sonic-boost.love/core/modules/menusystem/init.lua +++ b/sonic-boost.love/core/modules/menusystem/init.lua @@ -69,12 +69,14 @@ end function MenuSystem:mousepressed( x, y, button, istouch ) for k,v in pairs(self.menus) do - if (x > v.x) and (x < v.x + v.w) and (y > v.y) and (y < v.y + v.h) then - v:mousepressed(x - v.x, y - v.y, button, istouch ) - for j,u in ipairs(self.menus) do - u.focus = false + if v.isActive then + if (x > v.x) and (x < v.x + v.w) and (y > v.y) and (y < v.y + v.h) then + v:mousepressed(x - v.x, y - v.y, button, istouch ) + for j,u in ipairs(self.menus) do + u.focus = false + end + v.focus = true end - v.focus = true end end end