summaryrefslogtreecommitdiff
path: root/src/gui/storagewindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/storagewindow.h')
-rw-r--r--src/gui/storagewindow.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/storagewindow.h b/src/gui/storagewindow.h
index 766f2b1a..046b7613 100644
--- a/src/gui/storagewindow.h
+++ b/src/gui/storagewindow.h
@@ -49,8 +49,7 @@ class StorageWindow : public Window, gcn::ActionListener,
/**
* Constructor.
*/
- StorageWindow(int invSize = Net::getInventoryHandler()
- ->getSize(Net::InventoryHandler::STORAGE));
+ StorageWindow(Inventory *inventory);
/**
* Destructor.
@@ -75,22 +74,31 @@ class StorageWindow : public Window, gcn::ActionListener,
void mouseClicked(gcn::MouseEvent &event);
/**
+ * Closes the Storage Window, as well as telling the server that the
+ * window has been closed.
+ */
+ void close();
+
+ /**
* Add the specified ammount of the specified item to storage
*/
- void addStore(Item* item, int amount);
+ static void addStore(Item* item, int amount);
/**
* Remove the specified ammount of the specified item from storage
*/
- void removeStore(Item* item, int amount);
+ static void removeStore(Item* item, int amount);
/**
- * Closes the Storage Window, as well as telling the server that the
- * window has been closed.
+ * Returns true if any instances exist.
*/
- void close();
+ static bool isActive() { return instances.size() > 0; }
private:
+ typedef std::list<StorageWindow*> WindowList;
+ static WindowList instances;
+
+ Inventory *mInventory;
ItemContainer *mItems;
int mSlots;
@@ -101,11 +109,7 @@ class StorageWindow : public Window, gcn::ActionListener,
ProgressBar *mSlotsBar;
- int mMaxSlots;
-
bool mItemDesc;
};
-extern StorageWindow *storageWindow;
-
#endif // STORAGEWINDOW_H