diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-26 21:28:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-26 21:28:02 +0300 |
commit | 79031bf5faf547950087f40f3390ab09b21be3be (patch) | |
tree | 9abbdabc6a0ee0be101859c86dab58f74d9836bc /src | |
parent | 99382ed565d36422cc25230da31e334f1f161771 (diff) | |
download | plus-79031bf5faf547950087f40f3390ab09b21be3be.tar.gz plus-79031bf5faf547950087f40f3390ab09b21be3be.tar.bz2 plus-79031bf5faf547950087f40f3390ab09b21be3be.tar.xz plus-79031bf5faf547950087f40f3390ab09b21be3be.zip |
Add to context menu option all except 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/popupmenu.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index b4d5ec22a..c8351914f 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -981,6 +981,12 @@ void PopupMenu::handleLink(const std::string &link, mItem->getInvIndex(), mItem->getQuantity() / 2, Inventory::STORAGE); } + else if (link == "store all-1" && mItem) + { + Net::getInventoryHandler()->moveItem2(Inventory::INVENTORY, + mItem->getInvIndex(), mItem->getQuantity() - 1, + Inventory::STORAGE); + } else if (link == "store all" && mItem) { Net::getInventoryHandler()->moveItem2(Inventory::INVENTORY, @@ -1007,6 +1013,11 @@ void PopupMenu::handleLink(const std::string &link, if (tradeWindow) tradeWindow->tradeItem(mItem, mItem->getQuantity() / 2, true); } + else if (link == "addtrade all-1" && mItem) + { + if (tradeWindow) + tradeWindow->tradeItem(mItem, mItem->getQuantity() - 1, true); + } else if (link == "addtrade all" && mItem) { if (tradeWindow) @@ -1032,6 +1043,12 @@ void PopupMenu::handleLink(const std::string &link, mItem->getInvIndex(), mItem->getQuantity() / 2, Inventory::INVENTORY); } + else if (link == "retrieve all-1" && mItem) + { + Net::getInventoryHandler()->moveItem2(Inventory::STORAGE, + mItem->getInvIndex(), mItem->getQuantity() - 1, + Inventory::INVENTORY); + } else if (link == "retrieve all" && mItem) { Net::getInventoryHandler()->moveItem2(Inventory::STORAGE, @@ -1616,6 +1633,7 @@ void PopupMenu::showPopup(Window *parent, int x, int y, Item *item, if (cnt > 10) mBrowserBox->addRow("addtrade 10", _("Add to trade 10")); mBrowserBox->addRow("addtrade half", _("Add to trade half")); + mBrowserBox->addRow("addtrade all-1", _("Add to trade all-1")); mBrowserBox->addRow("addtrade all", _("Add to trade all")); } mBrowserBox->addRow("##3---"); @@ -1628,6 +1646,7 @@ void PopupMenu::showPopup(Window *parent, int x, int y, Item *item, if (cnt > 10) mBrowserBox->addRow("store 10", _("Store 10")); mBrowserBox->addRow("store half", _("Store half")); + mBrowserBox->addRow("store all-1", _("Store all-1")); mBrowserBox->addRow("store all", _("Store all")); } mBrowserBox->addRow("##3---"); @@ -1669,6 +1688,7 @@ void PopupMenu::showPopup(Window *parent, int x, int y, Item *item, if (cnt > 10) mBrowserBox->addRow("retrieve 10", _("Retrieve 10")); mBrowserBox->addRow("retrieve half", _("Retrieve half")); + mBrowserBox->addRow("retrieve all-1", _("Retrieve all-1")); mBrowserBox->addRow("retrieve all", _("Retrieve all")); } } |