diff options
Diffstat (limited to 'src/gui/inventorywindow.h')
-rw-r--r-- | src/gui/inventorywindow.h | 35 |
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; |