Merge pull request #872 from EgzoT/EgzoT-trade_request_ui

Sending trade request using "UICreatureButton"
This commit is contained in:
Henrique Santiago 2017-10-22 20:21:16 -03:00 committed by GitHub
commit 4e9e1555f4
1 changed files with 5 additions and 0 deletions

View File

@ -386,6 +386,11 @@ function onTradeWith(clickedWidget, mousePosition)
if tile then if tile then
g_game.requestTrade(selectedThing, tile:getTopCreature()) g_game.requestTrade(selectedThing, tile:getTopCreature())
end end
elseif clickedWidget:getClassName() == 'UICreatureButton' then
local creature = clickedWidget:getCreature()
if creature then
g_game.requestTrade(selectedThing, creature)
end
end end
end end