summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/viewport.cpp5
-rw-r--r--src/gui/viewport.h2
-rw-r--r--src/gui/windows/skilldialog.cpp10
3 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 745b11bed..832708a45 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -568,6 +568,11 @@ void Viewport::mousePressed(MouseEvent &event)
}
}
+void Viewport::getMouseTile(int &destX, int &destY)
+{
+ getMouseTile(mMouseX, mMouseY, destX, destY);
+}
+
void Viewport::getMouseTile(const int x, int y,
int &destX, int &destY)
{
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index f682cd96f..61fb87c02 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -172,6 +172,8 @@ class Viewport final : public WindowContainer,
void returnCamera();
+ void getMouseTile(int &destX, int &destY);
+
int mMouseX; /**< Current mouse position in pixels. */
int mMouseY; /**< Current mouse position in pixels. */
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 58a9292ae..bf317b8cd 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -708,6 +708,16 @@ void SkillDialog::useSkill(const SkillInfo *const info,
break;
case SkillType::Ground:
+ {
+ int x = 0;
+ int y = 0;
+ viewport->getMouseTile(x, y);
+ skillHandler->usePos(info->id,
+ info->level,
+ x, y);
+ break;
+ }
+
case SkillType::TargetTrap:
// for now unused
break;