diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-14 19:48:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-14 19:48:58 +0300 |
commit | 461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5 (patch) | |
tree | 98cd89f44c92ce56ff3f7ea125cf859dac49ae4b /src/gui/popups/popupmenu.cpp | |
parent | 135e4e0bda8a0f07471501975665f6157758b779 (diff) | |
download | manaverse-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.gz manaverse-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.bz2 manaverse-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.xz manaverse-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.zip |
Allow open submenus in same position with parent menu.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 1bfa0e3e1..c3bd94087 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -482,6 +482,22 @@ void PopupMenu::setMousePos() } } +void PopupMenu::setMousePos2() +{ + if (mX == 0 && mY == 0) + { + if (viewport) + { + mX = viewport->mMouseX; + mY = viewport->mMouseY; + } + else + { + Gui::getMouseState(mX, mY); + } + } +} + void PopupMenu::showPopup(const int x, const int y, const std::vector<ActorSprite*> &beings) { @@ -2392,7 +2408,7 @@ void PopupMenu::showSkillLevelPopup(const SkillInfo *const info) { if (!info) return; - setMousePos(); + setMousePos2(); // using mItemId as skill id mItemId = info->id; @@ -2430,7 +2446,7 @@ void PopupMenu::showSkillTypePopup(const SkillInfo *const info) { if (!info) return; - setMousePos(); + setMousePos2(); // using mItemId as skill id mItemId = info->id; |