Fix trade/use bug from previous commit

This commit is contained in:
Eduardo Bart 2013-01-30 18:57:37 -02:00
parent 5bf03c50d6
commit da050a5630
1 changed files with 2 additions and 1 deletions

View File

@ -58,8 +58,8 @@ function UIPopupMenu:addOption(optionName, optionCallback, shortcut)
local optionWidget = g_ui.createWidget(self:getStyleName() .. 'Button', self)
local lastOptionWidget = self:getLastChild()
optionWidget.onClick = function(self)
optionCallback()
self:getParent():destroy()
optionCallback()
end
optionWidget:setText(optionName)
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 15
@ -81,6 +81,7 @@ function UIPopupMenu:onDestroy()
if currentMenu == self then
currentMenu = nil
end
self:ungrabMouse()
end
function UIPopupMenu:onMousePress(mousePos, mouseButton)