diff options
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 57 |
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; |