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 | |
parent | 135e4e0bda8a0f07471501975665f6157758b779 (diff) | |
download | plus-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.gz plus-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.bz2 plus-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.tar.xz plus-461eb3a21a6872cf9a639ecbd6f9f21c8ff751b5.zip |
Allow open submenus in same position with parent menu.
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 20 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.h | 2 |
2 files changed, 20 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; diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index ba88e93f1..b84375dcd 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -188,6 +188,8 @@ class PopupMenu final : public Popup, public LinkHandler private: void setMousePos(); + void setMousePos2(); + void addPlayerRelation(const std::string &name); void addFollow(); |