summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-05-05 21:00:06 -0600
committerJared Adams <jaxad0127@gmail.com>2009-05-05 21:00:49 -0600
commit99dbfa9e84ea30993d44d2a39bd5d06ae553c849 (patch)
tree504f8b35ef76f7fb67a5a21f136a20b8d1566dea /src/gui/popupmenu.cpp
parentc305c76f82d832cb3db9e1edb805d24522a90c3f (diff)
downloadmana-client-99dbfa9e84ea30993d44d2a39bd5d06ae553c849.tar.gz
mana-client-99dbfa9e84ea30993d44d2a39bd5d06ae553c849.tar.bz2
mana-client-99dbfa9e84ea30993d44d2a39bd5d06ae553c849.tar.xz
mana-client-99dbfa9e84ea30993d44d2a39bd5d06ae553c849.zip
Fix the context menu for the storage window
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp56
1 files changed, 41 insertions, 15 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index b02e6f2a..c46f673c 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -23,6 +23,7 @@
#include "gui/chat.h"
#include "gui/inventorywindow.h"
+#include "gui/storagewindow.h"
#include "gui/itemamount.h"
#include "gui/widgets/browserbox.h"
@@ -290,6 +291,18 @@ void PopupMenu::handleLink(const std::string &link)
inventoryWindow, mItem);
}
+ else if (link == "store")
+ {
+ new ItemAmountWindow(ItemAmountWindow::StoreAdd,
+ inventoryWindow, mItem);
+ }
+
+ else if (link == "retrieve")
+ {
+ new ItemAmountWindow(ItemAmountWindow::StoreRemove,
+ storageWindow, mItem);
+ }
+
else if (link == "party" && being && being->getType() == Being::PLAYER)
{
player_node->inviteToParty(dynamic_cast<Player*>(being));
@@ -324,31 +337,44 @@ void PopupMenu::handleLink(const std::string &link)
mItem = NULL;
}
-void PopupMenu::showPopup(int x, int y, Item *item)
+void PopupMenu::showPopup(int x, int y, Item *item, bool isInventory)
{
assert(item);
mItem = item;
mBrowserBox->clearRows();
- if (item->isEquipment())
+ if (isInventory)
{
-#ifdef TMWSERV_SUPPORT
- mBrowserBox->addRow(_("@@use|Equip@@"));
-#else
- if (item->isEquipped())
- mBrowserBox->addRow(_("@@use|Unequip@@"));
+ if (item->isEquipment())
+ {
+ if (item->isEquipped())
+ mBrowserBox->addRow(_("@@use|Unequip@@"));
+ else
+ mBrowserBox->addRow(_("@@use|Equip@@"));
+ }
else
- mBrowserBox->addRow(_("@@use|Equip@@"));
-#endif
- }
- else
- mBrowserBox->addRow(_("@@use|Use@@"));
+ mBrowserBox->addRow(_("@@use|Use@@"));
+
+ mBrowserBox->addRow(_("@@drop|Drop@@"));
- mBrowserBox->addRow(_("@@drop|Drop@@"));
#ifdef TMWSERV_SUPPORT
- if (!item->isEquipment())
- mBrowserBox->addRow(_("@@split|Split@@"));
+ if (!item->isEquipment())
+ {
+ mBrowserBox->addRow(_("@@split|Split@@"));
+ }
#endif
+
+ if (player_node->getInStorage())
+ {
+ mBrowserBox->addRow(_("@@store|Store@@"));
+ }
+ }
+ // Assume in storage for now
+ // TODO: make this whole system more flexible, if needed
+ else
+ {
+ mBrowserBox->addRow(_("@@retrieve|Retrieve@@"));
+ }
mBrowserBox->addRow(_("@@chat|Add to chat@@"));
mBrowserBox->addRow("##3---");
mBrowserBox->addRow(_("@@cancel|Cancel@@"));