summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-14 19:25:00 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-14 19:25:00 +0300
commit8ea20d3e1f61bcfeccf6885e11cacddeb014fe0f (patch)
treebda5dc8f66925aed8a1671a9d806a407af7bef3f /src/gui/popups/popupmenu.cpp
parentf3781554bf946a22ac307d1c8fe6154db05bbf2e (diff)
downloadmanaverse-8ea20d3e1f61bcfeccf6885e11cacddeb014fe0f.tar.gz
manaverse-8ea20d3e1f61bcfeccf6885e11cacddeb014fe0f.tar.bz2
manaverse-8ea20d3e1f61bcfeccf6885e11cacddeb014fe0f.tar.xz
manaverse-8ea20d3e1f61bcfeccf6885e11cacddeb014fe0f.zip
Add skill cast type option in skills window.
Can be changed, but for now unused.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp57
1 files changed, 53 insertions, 4 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index d0896efaa..e7e866491 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2361,7 +2361,7 @@ void PopupMenu::showNpcDialogPopup(const BeingId npcId,
void PopupMenu::showSkillPopup(const SkillInfo *const info)
{
- if (!info || info->level <= 1)
+ if (!info)
return;
setMousePos();
@@ -2373,10 +2373,17 @@ void PopupMenu::showSkillPopup(const SkillInfo *const info)
// TRANSLATORS: popup menu header
mBrowserBox->addRow(_("Skill"));
- mBrowserBox->addRow("/showskilllevels 'ITEMID'",
+ if (info->level > 1)
+ {
+ mBrowserBox->addRow("/showskilllevels 'ITEMID'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: set skill level
+ _("Skill level..."));
+ }
+ mBrowserBox->addRow("/showskilltypes 'ITEMID'",
// TRANSLATORS: popup menu item
- // TRANSLATORS: set skill level
- _("Set skill level"));
+ // TRANSLATORS: set skill cast type
+ _("Skill cast type..."));
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
mBrowserBox->addRow("cancel", _("Cancel"));
@@ -2422,6 +2429,48 @@ void PopupMenu::showSkillLevelMenu()
showPopup(mX, mY);
}
+void PopupMenu::showSkillTypePopup(const SkillInfo *const info)
+{
+ if (!info)
+ return;
+ setMousePos();
+
+ // using mItemId as skill id
+ mItemId = info->id;
+ // using mItemIndex as skill level
+ mItemIndex = info->level;
+
+ for (int f = 0; f < maxCards; f ++)
+ mItemCards[f] = 0;
+ mBrowserBox->clearRows();
+
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: skill cast type header
+ mBrowserBox->addRow(_("Select skill cast type"));
+ mBrowserBox->addRow(strprintf("/selectskilltype %d 0", mItemId),
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: skill cast type
+ _("Default"));
+ mBrowserBox->addRow(strprintf("/selectskilltype %d 1", mItemId),
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: skill cast type
+ _("Target"));
+ mBrowserBox->addRow(strprintf("/selectskilltype %d 2", mItemId),
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: skill cast type
+ _("Mouse position"));
+ mBrowserBox->addRow(strprintf("/selectskilltype %d 3", mItemId),
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: skill cast type
+ _("Self"));
+ mBrowserBox->addRow("##3---");
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: close menu
+ mBrowserBox->addRow("cancel", _("Cancel"));
+
+ showPopup(mX, mY);
+}
+
void PopupMenu::showPopup(int x, int y)
{
const int pad2 = 2 * mPadding;