summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-25 12:18:43 -0600
committerJared Adams <jaxad0127@gmail.com>2010-03-25 12:42:43 -0600
commitf781215c6401343d287798b58b08183e71ef57e3 (patch)
treeb07001f8ee295c4ba8617c5168805269530bd9d1 /src/gui/inventorywindow.h
parentbf6cb46d9b06b06470efd5ad3ebae7e274f6906f (diff)
downloadmana-client-f781215c6401343d287798b58b08183e71ef57e3.tar.gz
mana-client-f781215c6401343d287798b58b08183e71ef57e3.tar.bz2
mana-client-f781215c6401343d287798b58b08183e71ef57e3.tar.xz
mana-client-f781215c6401343d287798b58b08183e71ef57e3.zip
Merge StorageWindow into InventoryWindow
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui/inventorywindow.h')
-rw-r--r--src/gui/inventorywindow.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index cfea130f..406c24bf 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -24,7 +24,6 @@
#include "inventory.h"
-#include "gui/storagewindow.h"
#include "gui/widgets/window.h"
#include "net/inventoryhandler.h"
@@ -54,7 +53,7 @@ class InventoryWindow : public Window,
/**
* Constructor.
*/
- InventoryWindow();
+ InventoryWindow(Inventory *inventory, bool isMainInventory = false);
/**
* Destructor.
@@ -95,6 +94,12 @@ class InventoryWindow : public Window,
* Sets whether the split button should be shown.
*/
void setSplitAllowed(bool allowed);
+
+ /**
+ * Closes the Storage Window, as well as telling the server that the
+ * window has been closed.
+ */
+ void close();
/**
* Updates the weight bar.
@@ -103,24 +108,28 @@ class InventoryWindow : public Window,
void slotsChanged(Inventory* inventory);
+ /**
+ * Returns true if any instances exist.
+ */
+ static bool isStorageActive() { return instances.size() > 1; }
+
private:
+ typedef std::list<InventoryWindow*> WindowList;
+ static WindowList instances;
+
+ Inventory *mInventory;
ItemContainer *mItems;
- std::string mWeight;
- std::string mSlots;
+ std::string mWeight, mSlots;
+
+ gcn::Button *mUseButton, *mDropButton, *mSplitButton, *mOutfitButton,
+ *mStoreButton, *mRetrieveButton;
- gcn::Button *mUseButton;
- gcn::Button *mDropButton;
- gcn::Button *mSplitButton;
- gcn::Button *mOutfitButton;
- gcn::Label *mWeightLabel;
- gcn::Label *mSlotsLabel;
+ gcn::Label *mWeightLabel, *mSlotsLabel;
- ProgressBar *mWeightBar;
- ProgressBar *mSlotsBar;
+ ProgressBar *mWeightBar, *mSlotsBar;
bool mSplit;
- bool mItemDesc;
};
extern InventoryWindow *inventoryWindow;