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".
This commit is contained in:
parent
8c731ac016
commit
bc507fd98b
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue