diff options
Diffstat (limited to 'src')
-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 603e7e50..67525140 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -19,6 +19,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" @@ -184,9 +185,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); @@ -247,7 +247,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 2b8ab8f3..5981f121 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -126,6 +126,8 @@ void StorageWindow::action(const gcn::ActionEvent &event) } else 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 2deabbf2..30604d6b 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -240,6 +240,8 @@ void TradeWindow::action(const gcn::ActionEvent &event) if (event.getId() == "add") { + if (!inventoryWindow->isVisible()) return; + if (!item) return; |