From 5bbad4bc6bb8a6de5e259ad56a77ac34784fdb77 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Dec 2014 23:15:04 +0300 Subject: Add open context menu action. No key assigned. New chat command: contextmenu --- src/actions/target.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/actions/target.cpp') 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 -- cgit v1.2.3-60-g2f50