diff options
-rw-r--r-- | src/gui/storagewindow.cpp | 7 | ||||
-rw-r--r-- | src/gui/storagewindow.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index 4804bdcb..535d68b7 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -65,6 +65,8 @@ StorageWindow::StorageWindow(int invSize): mStoreButton = new Button(_("Store"), "store", this); mRetrieveButton = new Button(_("Retrieve"), "retrieve", this); + mCloseButton = new Button(_("Close"), "close", this); + mItems = new ItemContainer(player_node->getStorage(), true); mItems->addSelectionListener(this); @@ -85,6 +87,7 @@ StorageWindow::StorageWindow(int invSize): place(0, 0, mSlotsLabel).setPadding(3); place(1, 0, mSlotsBar, 3); place(0, 1, invenScroll, 4, 4); + place(0, 5, mCloseButton); place(2, 5, mStoreButton); place(3, 5, mRetrieveButton); @@ -140,6 +143,10 @@ void StorageWindow::action(const gcn::ActionEvent &event) ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, this, item); } + else if (event.getId() == "close") + { + close(); + } } void StorageWindow::mouseClicked(gcn::MouseEvent &event) diff --git a/src/gui/storagewindow.h b/src/gui/storagewindow.h index 4ccf324c..452ce735 100644 --- a/src/gui/storagewindow.h +++ b/src/gui/storagewindow.h @@ -91,7 +91,7 @@ class StorageWindow : public Window, gcn::ActionListener, int mSlots; int mUsedSlots; - gcn::Button *mStoreButton, *mRetrieveButton; + gcn::Button *mStoreButton, *mRetrieveButton, *mCloseButton; gcn::Label *mSlotsLabel; |