From 6904ba97e488c7c69923de0b8831d93ebb0143ca Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Thu, 14 Oct 2010 23:40:12 +0000
Subject: [PATCH] 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
---
 game/modules/tome/dialogs/MapMenu.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/game/modules/tome/dialogs/MapMenu.lua b/game/modules/tome/dialogs/MapMenu.lua
index 89355c6d92..58a89ceafb 100644
--- a/game/modules/tome/dialogs/MapMenu.lua
+++ b/game/modules/tome/dialogs/MapMenu.lua
@@ -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
 
-- 
GitLab