summaryrefslogtreecommitdiff
path: root/src/gui/windows/inventorywindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-24 21:40:25 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-24 21:40:25 +0300
commit750fb61bd3cda4ffe775ab5e45ff6ff2ed5cb4ba (patch)
treedf83b2c115f3d6d472a8d1ab9a43b1b73d714d13 /src/gui/windows/inventorywindow.cpp
parent5deadbb0d4a7c770667b8c06f72902a9aa6db6b7 (diff)
downloadplus-750fb61bd3cda4ffe775ab5e45ff6ff2ed5cb4ba.tar.gz
plus-750fb61bd3cda4ffe775ab5e45ff6ff2ed5cb4ba.tar.bz2
plus-750fb61bd3cda4ffe775ab5e45ff6ff2ed5cb4ba.tar.xz
plus-750fb61bd3cda4ffe775ab5e45ff6ff2ed5cb4ba.zip
allow store and retreive buttons work with cart.
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r--src/gui/windows/inventorywindow.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 535f87f59..36bcc64ac 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -384,7 +384,16 @@ void InventoryWindow::action(const ActionEvent &event)
if (!item)
return;
- ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, this, item);
+ if (storageWindow)
+ {
+ ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd,
+ this, item);
+ }
+ else if (cartWindow)
+ {
+ ItemAmountWindow::showWindow(ItemAmountWindow::CartAdd,
+ this, item);
+ }
}
else if (eventId == "sort")
{
@@ -422,8 +431,14 @@ void InventoryWindow::action(const ActionEvent &event)
if (isStorageActive())
{
inventoryHandler->moveItem2(InventoryType::INVENTORY,
- item->getInvIndex(), item->getQuantity(),
- InventoryType::STORAGE);
+ item->getInvIndex(), item->getQuantity(),
+ InventoryType::STORAGE);
+ }
+ else if (cartWindow)
+ {
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
+ item->getInvIndex(), item->getQuantity(),
+ InventoryType::CART);
}
else
{
@@ -449,8 +464,16 @@ void InventoryWindow::action(const ActionEvent &event)
}
else if (eventId == "retrieve")
{
- ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove,
- this, item);
+ if (storageWindow)
+ {
+ ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove,
+ this, item);
+ }
+ else if (cartWindow)
+ {
+ ItemAmountWindow::showWindow(ItemAmountWindow::CartRemove,
+ this, item);
+ }
}
}
@@ -773,7 +796,7 @@ void InventoryWindow::updateDropButton()
if (!mDropButton)
return;
- if (isStorageActive())
+ if (isStorageActive() || cartWindow)
{
// TRANSLATORS: inventory button
mDropButton->setCaption(_("Store"));