diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-02-24 15:21:11 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-02-24 15:51:39 -0700 |
commit | d039422e70e47a762ef61de619e9e98780b12664 (patch) | |
tree | d0cb68147e6fe37a8c85e4907766976bf79547b4 /src/gui/storagewindow.h | |
parent | 84cf9bcc38028696d02c03cd523b7997906b9f01 (diff) | |
download | mana-d039422e70e47a762ef61de619e9e98780b12664.tar.gz mana-d039422e70e47a762ef61de619e9e98780b12664.tar.bz2 mana-d039422e70e47a762ef61de619e9e98780b12664.tar.xz mana-d039422e70e47a762ef61de619e9e98780b12664.zip |
Move StorageWindow to instancing intead of global
Also make storage under eAthena more flexible.
Reviewed-by: Dennis Friis
Diffstat (limited to 'src/gui/storagewindow.h')
-rw-r--r-- | src/gui/storagewindow.h | 26 |
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 |