Fix trade/use bug from previous commit
This commit is contained in:
parent
5bf03c50d6
commit
da050a5630
|
@ -58,8 +58,8 @@ function UIPopupMenu:addOption(optionName, optionCallback, shortcut)
|
||||||
local optionWidget = g_ui.createWidget(self:getStyleName() .. 'Button', self)
|
local optionWidget = g_ui.createWidget(self:getStyleName() .. 'Button', self)
|
||||||
local lastOptionWidget = self:getLastChild()
|
local lastOptionWidget = self:getLastChild()
|
||||||
optionWidget.onClick = function(self)
|
optionWidget.onClick = function(self)
|
||||||
optionCallback()
|
|
||||||
self:getParent():destroy()
|
self:getParent():destroy()
|
||||||
|
optionCallback()
|
||||||
end
|
end
|
||||||
optionWidget:setText(optionName)
|
optionWidget:setText(optionName)
|
||||||
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 15
|
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 15
|
||||||
|
@ -81,6 +81,7 @@ function UIPopupMenu:onDestroy()
|
||||||
if currentMenu == self then
|
if currentMenu == self then
|
||||||
currentMenu = nil
|
currentMenu = nil
|
||||||
end
|
end
|
||||||
|
self:ungrabMouse()
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIPopupMenu:onMousePress(mousePos, mouseButton)
|
function UIPopupMenu:onMousePress(mousePos, mouseButton)
|
||||||
|
|
Loading…
Reference in New Issue