summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-15 19:55:42 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-15 19:55:42 +0300
commit75d94c3c01eaa828d8e96767b06e3d0c3019ffa3 (patch)
treebe72fab95329eff4da04f2dbe2e56dec2781e47b /src/gui/popups/popupmenu.cpp
parenta520caf57d759e725d8e63d1c47d9b3d5e779324 (diff)
downloadmanaverse-75d94c3c01eaa828d8e96767b06e3d0c3019ffa3.tar.gz
manaverse-75d94c3c01eaa828d8e96767b06e3d0c3019ffa3.tar.bz2
manaverse-75d94c3c01eaa828d8e96767b06e3d0c3019ffa3.tar.xz
manaverse-75d94c3c01eaa828d8e96767b06e3d0c3019ffa3.zip
Change cast offset in skills dialog.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index b7a7a282e..8257033b4 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2397,6 +2397,14 @@ void PopupMenu::showSkillPopup(const SkillInfo *const info)
// TRANSLATORS: popup menu item
// TRANSLATORS: set skill cast type
_("Skill cast type..."));
+ mBrowserBox->addRow("/showskilloffsetx 'ITEMID'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: set skill cast offset by x
+ _("Skill offset by x..."));
+ mBrowserBox->addRow("/showskilloffsety 'ITEMID'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: set skill cast offset by y
+ _("Skill offset by y..."));
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
mBrowserBox->addRow("cancel", _("Cancel"));
@@ -2404,6 +2412,53 @@ void PopupMenu::showSkillPopup(const SkillInfo *const info)
showPopup(mX, mY);
}
+void PopupMenu::showSkillOffsetPopup(const SkillInfo *const info,
+ const bool isOffsetX)
+{
+ if (!info)
+ return;
+ setMousePos2();
+
+ // using mItemId as skill id
+ mItemId = info->id;
+ // using mItemIndex as skill level
+ mItemIndex = info->level;
+ mBrowserBox->clearRows();
+ char letter = ' ';
+
+ if (isOffsetX)
+ {
+ // TRANSLATORS: popup menu header
+ mBrowserBox->addRow(_("Skill cast offset by x"));
+ letter = 'x';
+ }
+ else
+ {
+ // TRANSLATORS: popup menu header
+ mBrowserBox->addRow(_("Skill cast offset by y"));
+ letter = 'y';
+ }
+ for (int f = -9; f <= 9; f ++)
+ {
+ const std::string command = strprintf(
+ "/setskilloffset%c 'ITEMID' %d", letter, f);
+ if (f == 0)
+ {
+ mBrowserBox->addRow(command,
+ strprintf("%d", f).c_str());
+ }
+ else
+ {
+ mBrowserBox->addRow(command,
+ strprintf("%+d", f).c_str());
+ }
+ }
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: close menu
+ mBrowserBox->addRow("cancel", _("Cancel"));
+ showPopup(mX, mY);
+}
+
void PopupMenu::showSkillLevelPopup(const SkillInfo *const info)
{
if (!info)