core/menusystem: only count click if menu is currently active
This commit is contained in:
parent
205de52345
commit
28beee9c41
1 changed files with 7 additions and 5 deletions
|
@ -69,6 +69,7 @@ end
|
||||||
|
|
||||||
function MenuSystem:mousepressed( x, y, button, istouch )
|
function MenuSystem:mousepressed( x, y, button, istouch )
|
||||||
for k,v in pairs(self.menus) do
|
for k,v in pairs(self.menus) do
|
||||||
|
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
|
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 )
|
v:mousepressed(x - v.x, y - v.y, button, istouch )
|
||||||
for j,u in ipairs(self.menus) do
|
for j,u in ipairs(self.menus) do
|
||||||
|
@ -78,6 +79,7 @@ function MenuSystem:mousepressed( x, y, button, istouch )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function MenuSystem:draw(dt) -- On dessine les entitées
|
function MenuSystem:draw(dt) -- On dessine les entitées
|
||||||
for k,v in pairs(self.menus) do
|
for k,v in pairs(self.menus) do
|
||||||
|
|
Loading…
Reference in a new issue