summaryrefslogtreecommitdiff
path: root/src/actionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actionmanager.cpp')
-rw-r--r--src/actionmanager.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 8775839ca..1c7dbce14 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -40,6 +40,7 @@
#include "gui/windows/skilldialog.h"
#include "gui/windows/socialwindow.h"
#include "gui/windows/statuswindow.h"
+#include "gui/windows/tradewindow.h"
#include "gui/windows/questswindow.h"
#include "gui/windows/quitdialog.h"
#include "gui/windows/whoisonline.h"
@@ -67,6 +68,7 @@
#include "net/net.h"
#include "net/playerhandler.h"
+#include "net/tradehandler.h"
#include "utils/gettext.h"
@@ -82,6 +84,7 @@
#define impHandler0(name) bool name(const InputEvent &event A_UNUSED)
extern ShortcutWindow *spellShortcutWindow;
+extern std::string tradePartnerName;
extern QuitDialog *quitDialog;
namespace ActionManager
@@ -1189,4 +1192,18 @@ impHandler0(prevCommandsTab)
return false;
}
+impHandler0(openTrade)
+{
+ const Being *const being = player_node->getTarget();
+ if (being && being->getType() == ActorSprite::PLAYER)
+ {
+ Net::getTradeHandler()->request(being);
+ tradePartnerName = being->getName();
+ if (tradeWindow)
+ tradeWindow->clear();
+ return true;
+ }
+ return false;
+}
+
} // namespace ActionManager