diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
commit | 382067b05c4fe97bcf0da0143405375ec295f7c6 (patch) | |
tree | f668cd2595ac0c85f0942f88729d3ff1956676fa /src/actionmanager.cpp | |
parent | ee8191705826d978b7793497fdd307536c709bff (diff) | |
parent | 9b329556e748050c4300174e9bdc72b15e5b8cc5 (diff) | |
download | plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.gz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.bz2 plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.xz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/actionmanager.cpp')
-rw-r--r-- | src/actionmanager.cpp | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index bc7be23a9..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" @@ -57,7 +58,7 @@ #include "gui/windows/ministatuswindow.h" #include "gui/windows/npcdialog.h" #include "gui/windows/outfitwindow.h" -#include "gui/windows/setup.h" +#include "gui/windows/setupwindow.h" #include "gui/windows/shopwindow.h" #include "gui/windows/shortcutwindow.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 @@ -215,7 +218,7 @@ impHandler0(mouseClick) return false; int mouseX, mouseY; - gui->getMouseState(&mouseX, &mouseY); + Gui::getMouseState(&mouseX, &mouseY); guiInput->simulateMouseClick(mouseX, mouseY, gcn::MouseEvent::RIGHT); return true; } @@ -1149,4 +1152,58 @@ impHandler0(showWindows) return false; } +impHandler0(nextShortcutsTab) +{ + if (itemShortcutWindow) + { + itemShortcutWindow->nextTab(); + return true; + } + return false; +} + +impHandler0(prevShortcutsTab) +{ + if (itemShortcutWindow) + { + itemShortcutWindow->prevTab(); + return true; + } + return false; +} + +impHandler0(nextCommandsTab) +{ + if (spellShortcutWindow) + { + spellShortcutWindow->nextTab(); + return true; + } + return false; +} + +impHandler0(prevCommandsTab) +{ + if (spellShortcutWindow) + { + spellShortcutWindow->prevTab(); + return true; + } + 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 |