Sending trade request using "UICreatureButton"

Extending the possibilities of "UICreatureButton" widget.
Adding possibility sending trade request in battle list (game_battle module) and other modules who use widget "UICreatureButton".
master
EgzoT 7 years ago committed by GitHub
parent 8c731ac016
commit bc507fd98b

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

Loading…
Cancel
Save