summaryrefslogtreecommitdiff
path: root/src/actions/target.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-08 23:15:04 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-08 23:15:04 +0300
commit5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77 (patch)
tree8c88308918a6d707640c5c314d80b40ac45e434d /src/actions/target.cpp
parentf019a9e52d0a3f5ca23681d5eb36bb2e56d37064 (diff)
downloadmanaverse-5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77.tar.gz
manaverse-5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77.tar.bz2
manaverse-5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77.tar.xz
manaverse-5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77.zip
Add open context menu action.
No key assigned. New chat command: contextmenu
Diffstat (limited to 'src/actions/target.cpp')
-rw-r--r--src/actions/target.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/actions/target.cpp b/src/actions/target.cpp
index 8212a3a97..e59c2922d 100644
--- a/src/actions/target.cpp
+++ b/src/actions/target.cpp
@@ -26,6 +26,8 @@
#include "being/localplayer.h"
+#include "gui/popups/popupmenu.h"
+
#include "debug.h"
namespace Actions
@@ -76,4 +78,16 @@ impHandler0(targetPet)
return setTarget(ActorType::Pet, true);
}
+impHandler0(contextMenu)
+{
+ if (!localPlayer)
+ return false;
+ Being *const target = localPlayer->getTarget();
+ if (!target)
+ return true;
+
+ popupMenu->showPopup(target->getPixelX(), target->getPixelY(), target);
+ return true;
+}
+
} // namespace Actions