From 0c3770d8aec1b56ad704e88d6e6d510ddc4af9a1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 Jun 2011 23:44:23 +0300 Subject: Extend quick move items from inventory to storage and back. Add new key for quick actions "modifier key". --- src/gui/popupmenu.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/gui/popupmenu.cpp') diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 8497b2924..766e968ad 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -967,6 +967,10 @@ void PopupMenu::handleLink(const std::string &link, ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop, inventoryWindow, mItem); } + else if (link == "drop all" && mItem) + { + Net::getInventoryHandler()->dropItem(mItem, mItem->getQuantity()); + } else if (link == "store" && mItem) { ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, @@ -1539,9 +1543,14 @@ void PopupMenu::showPopup(Window *parent, int x, int y, Item *item, mBrowserBox->addRow(strprintf("@@use|%s@@", _("Use"))); if (cnt > 1) + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop..."))); + mBrowserBox->addRow(strprintf("@@drop all|%s@@", _("Drop all"))); + } else + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop"))); + } if (Net::getInventoryHandler()->canSplit(item)) mBrowserBox->addRow(strprintf("@@split|%s@@", _("Split"))); @@ -1631,9 +1640,14 @@ void PopupMenu::showItemPopup(int x, int y, Item *item) } if (item->getQuantity() > 1) + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop..."))); + mBrowserBox->addRow(strprintf("@@drop all|%s@@", _("Drop all"))); + } else + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop"))); + } if (Net::getInventoryHandler()->canSplit(item)) mBrowserBox->addRow(strprintf("@@split|%s@@", _("Split"))); @@ -1669,9 +1683,14 @@ void PopupMenu::showDropPopup(int x, int y, Item *item) mBrowserBox->addRow(strprintf("@@use|%s@@", _("Use"))); if (item->getQuantity() > 1) + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop..."))); + mBrowserBox->addRow(strprintf("@@drop all|%s@@", _("Drop all"))); + } else + { mBrowserBox->addRow(strprintf("@@drop|%s@@", _("Drop"))); + } if (Net::getInventoryHandler()->canSplit(item)) mBrowserBox->addRow(strprintf("@@split|%s@@", _("Split"))); -- cgit v1.2.3-60-g2f50