diff options
-rw-r--r-- | src/actions/actions.cpp | 15 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 17 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 86191d51c..93e160750 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -451,12 +451,21 @@ impHandler0(copyEquippedToOutfit) impHandler0(pickup) { - if (localPlayer) + if (!localPlayer) + return false; + + const std::string args = event.args; + if (args.empty()) { localPlayer->pickUpItems(); - return true; } - return false; + else + { + FloorItem *const item = actorManager->findItem(atoi(args.c_str())); + if (item) + localPlayer->pickUp(item); + } + return true; } static void doSit() diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index fabf42eb7..9162a1573 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -564,7 +564,7 @@ void PopupMenu::showPopup(const int x, const int y, { // TRANSLATORS: popup menu item // TRANSLATORS: pickup item from ground - mBrowserBox->addRow("pickup", _("Pick up")); + mBrowserBox->addRow("/pickup 'FLOORID'", _("Pick up")); mBrowserBox->addRow("##3---"); } addPickupFilter(name); @@ -573,7 +573,7 @@ void PopupMenu::showPopup(const int x, const int y, { // TRANSLATORS: popup menu item // TRANSLATORS: pickup item from ground - mBrowserBox->addRow("pickup", _("Pick up")); + mBrowserBox->addRow("/pickup 'FLOORID'", _("Pick up")); } addProtection(); // TRANSLATORS: popup menu item @@ -981,18 +981,7 @@ void PopupMenu::handleLink(const std::string &link, if (actorManager) being = actorManager->findBeing(mBeingId); - // Pick Up Floor Item action - if ((link == "pickup") && mFloorItemId) - { - if (localPlayer && actorManager) - { - FloorItem *const item = actorManager->findItem( - mFloorItemId); - if (item) - localPlayer->pickUp(item); - } - } - else if (link == "use" && mItemId) + if (link == "use" && mItemId) { if (mItemId < SPELL_MIN_ID) { |