From bc507fd98bfb7749814033e79cf66cb2a62599e5 Mon Sep 17 00:00:00 2001 From: EgzoT Date: Sun, 22 Oct 2017 23:21:02 +0200 Subject: [PATCH] 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". --- modules/game_interface/gameinterface.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 09930e27..1ad1a205 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -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