summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp20
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;