mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
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:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user