Skip to content
Snippets Groups Projects
Commit 6904ba97 authored by dg's avatar dg
Browse files

The right-click menu is closable with a right click

git-svn-id: http://svn.net-core.org/repos/t-engine4@1519 51575b47-30f0-44d4-a5cc-537603b46e54
parent c879caf7
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,9 @@ function _M:init(mx, my, tmx, tmy)
self.force_y = my - (self.h - self.ih + list.fh / 3)
end)
self.mouse:reset()
self.mouse:registerZone(0, 0, game.w, game.h, function(button, x, y, xrel, yrel, bx, by, event) if (button == "left" or button == "right") and event == "button" then self.key:triggerVirtual("EXIT") end end)
self.mouse:registerZone(self.display_x, self.display_y, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event) if button == "right" and event == "button" then self.key:triggerVirtual("EXIT") else self:mouseEvent(button, x, y, xrel, yrel, bx, by, event) end end)
self.key:addBinds{ EXIT = function() game:unregisterDialog(self) end, }
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment