diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-11 11:34:43 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-11 15:00:36 -0600 |
commit | a34d8a88df817371823e8e036b3a9208f8d5ba85 (patch) | |
tree | 16d15ba60685c9afe5cc26c59c41baff1efcf0e4 | |
parent | 9935a143cc9c2cd672889965b5db647921cf0210 (diff) | |
download | mana-client-a34d8a88df817371823e8e036b3a9208f8d5ba85.tar.gz mana-client-a34d8a88df817371823e8e036b3a9208f8d5ba85.tar.bz2 mana-client-a34d8a88df817371823e8e036b3a9208f8d5ba85.tar.xz mana-client-a34d8a88df817371823e8e036b3a9208f8d5ba85.zip |
Don't move stuff from inventory when not visible
-rw-r--r-- | src/gui/itemshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/storagewindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/trade.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index abe81537..cb709227 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "inventorywindow.h" #include "itemshortcutcontainer.h" #include "itempopup.h" #include "viewport.h" @@ -168,9 +169,8 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) if (event.getButton() == gcn::MouseEvent::LEFT) { - // Stores the selected item if theirs one. - if (itemShortcut->isItemSelected()) + if (itemShortcut->isItemSelected() && inventoryWindow->isVisible()) { itemShortcut->setItem(index); itemShortcut->setItemSelected(-1); @@ -231,7 +231,7 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) Item *item = player_node->getInventory()->findItem(itemId); - if (item) + if (item && inventoryWindow->isVisible()) { mItemPopup->setItem(item->getInfo()); mItemPopup->setOpaque(false); diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index ca7a547f..6a813bc4 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -121,6 +121,8 @@ void StorageWindow::action(const gcn::ActionEvent &event) { if (event.getId() == "store") { + if (!inventoryWindow->isVisible()) return; + Item *item = inventoryWindow->getSelectedItem(); if (!item) diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index a28ff0f9..caae33c0 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -239,6 +239,8 @@ void TradeWindow::action(const gcn::ActionEvent &event) if (event.getId() == "add") { + if (!inventoryWindow->isVisible()) return; + if (!item) return; |