summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-27 16:51:24 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-27 16:51:24 +0300
commit99bdcc0bbd6ec410958d8edf320a5ba6f1dba55a (patch)
treed80b0ecaaf012d81ebe1aabe643bd2c106e790cb /src/gui
parent7b22a33e04278723b0a93e99148df6e1cda641a2 (diff)
downloadplus-99bdcc0bbd6ec410958d8edf320a5ba6f1dba55a.tar.gz
plus-99bdcc0bbd6ec410958d8edf320a5ba6f1dba55a.tar.bz2
plus-99bdcc0bbd6ec410958d8edf320a5ba6f1dba55a.tar.xz
plus-99bdcc0bbd6ec410958d8edf320a5ba6f1dba55a.zip
Unselect item in inventory if it was added to outfit window.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inventorywindow.cpp5
-rw-r--r--src/gui/inventorywindow.h5
-rw-r--r--src/gui/outfitwindow.cpp5
3 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index c3d5460ce..7ceeb6e34 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -373,6 +373,11 @@ Item *InventoryWindow::getSelectedItem() const
return mItems->getSelectedItem();
}
+void InventoryWindow::unselectItem()
+{
+ mItems->selectNone();
+}
+
void InventoryWindow::widgetHidden(const gcn::Event &event)
{
Window::widgetHidden(event);
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index 47194b909..c4e0f66a6 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -78,6 +78,11 @@ class InventoryWindow : public Window,
Item* getSelectedItem() const;
/**
+ * Unselect item
+ */
+ void unselectItem();
+
+ /**
* Handles closing of the window
*/
void widgetHidden(const gcn::Event &event);
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index 009b92e73..502e9d96b 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -34,6 +34,7 @@
#include "playerinfo.h"
#include "gui/chatwindow.h"
+#include "gui/inventorywindow.h"
#include "gui/theme.h"
#include "gui/viewport.h"
@@ -422,7 +423,9 @@ void OutfitWindow::mousePressed(gcn::MouseEvent &event)
{
mItems[mCurrentOutfit][index] = mItemSelected;
mItemColors[mCurrentOutfit][index] = mItemColorSelected;
-// mItemSelected = -1;
+
+ if (inventoryWindow)
+ inventoryWindow->unselectItem();
}
else if (mItems[mCurrentOutfit][index])
{