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