diff options
Diffstat (limited to 'src/gui/popups')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 42 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.h | 4 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index b1b33155c..d1e23b558 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -72,6 +72,7 @@ #ifdef EATHENA_SUPPORT #include "net/homunculushandler.h" #include "net/mercenaryhandler.h" +#include "net/npchandler.h" #endif #include "net/pethandler.h" #include "net/serverfeatures.h" @@ -1473,6 +1474,11 @@ void PopupMenu::handleLink(const std::string &link, { homunculusHandler->fire(); } + else if (link == "craftmenu") + { + showCraftPopup(); + return; + } #endif else if (link == "pet feed") { @@ -1733,6 +1739,20 @@ void PopupMenu::showPopup(Window *const parent, } mBrowserBox->addRow("##3---"); } +#ifdef EATHENA_SUPPORT + if (npcHandler) + { + NpcDialog *const dialog = npcHandler->getCurrentNpcDialog(); + if (dialog && + dialog->getInputState() == NpcDialog::NPC_INPUT_ITEM_CRAFT) + { + mBrowserBox->addRow("craftmenu", + // TRANSLATORS: popup menu item + // TRANSLATORS: sub menu for craft + _("Move to craft...")); + } + } +#endif addUseDrop(item, isProtected); break; @@ -2787,6 +2807,28 @@ void PopupMenu::showGMPopup() showPopup(getX(), getY()); } +#ifdef EATHENA_SUPPORT +void PopupMenu::showCraftPopup() +{ + mBrowserBox->clearRows(); + + for (int f = 0; f < 9; f ++) + { + const std::string cmd = strprintf("/craft %d", f); + mBrowserBox->addRow(cmd, + // TRANSLATORS: popup menu item + // TRANSLATORS: move current item to craft slot + strprintf(_("Move to craft %d"), f + 1).c_str()); + } + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + + showPopup(mX, mY); +} +#endif + void PopupMenu::moveUp() { mBrowserBox->moveSelectionUp(); diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 798a4359a..ca6d58ee6 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -158,6 +158,10 @@ class PopupMenu final : public Popup, public LinkHandler void showSkillPopup(const SkillInfo *const info); +#ifdef EATHENA_SUPPORT + void showCraftPopup(); +#endif + /** * Handles link action. */ |