summaryrefslogtreecommitdiff
path: root/src/actionmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-08 16:26:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-08 16:26:46 +0300
commit899ad3c232a1d60111b646637a53698234cd4eea (patch)
tree7209b7ad4f9d2963c58dcf3547c3b34ef1edaba9 /src/actionmanager.cpp
parent82a4015692e630f36f94a55590c1b59b958c5a17 (diff)
downloadmv-899ad3c232a1d60111b646637a53698234cd4eea.tar.gz
mv-899ad3c232a1d60111b646637a53698234cd4eea.tar.bz2
mv-899ad3c232a1d60111b646637a53698234cd4eea.tar.xz
mv-899ad3c232a1d60111b646637a53698234cd4eea.zip
Add action for open trade window.
Default key unassigned.
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