diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-22 18:46:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-22 18:46:20 +0300 |
commit | dbe4b0a70a8ccf4c3be329f168d4388ba4b029b5 (patch) | |
tree | 9f7e4bbda2b28fdbaa8c4f1720ad71c1a8833338 | |
parent | 7aa3784a5d62848af60aabc3f82b19fb068b9d79 (diff) | |
download | manaverse-dbe4b0a70a8ccf4c3be329f168d4388ba4b029b5.tar.gz manaverse-dbe4b0a70a8ccf4c3be329f168d4388ba4b029b5.tar.bz2 manaverse-dbe4b0a70a8ccf4c3be329f168d4388ba4b029b5.tar.xz manaverse-dbe4b0a70a8ccf4c3be329f168d4388ba4b029b5.zip |
Add equipment button to inventory window.
-rw-r--r-- | src/gui/inventorywindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index b2c92a32c..e4a318d69 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -31,6 +31,7 @@ #include "playerinfo.h" #include "units.h" +#include "gui/equipmentwindow.h" #include "gui/gui.h" #include "gui/itemamountwindow.h" #include "gui/outfitwindow.h" @@ -176,6 +177,7 @@ InventoryWindow::InventoryWindow(Inventory *inventory): mSplitButton = new Button(_("Split"), "split", this); mOutfitButton = new Button(_("Outfits"), "outfit", this); mShopButton = new Button(_("Shop"), "shop", this); + mEquipmentButton = new Button(_("Equipment"), "equipment", this); mWeightLabel = new Label(_("Weight:")); mWeightBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_WEIGHT); @@ -193,9 +195,10 @@ InventoryWindow::InventoryWindow(Inventory *inventory): place(0, 2, invenScroll, 11).setPadding(3); place(0, 3, mUseButton); place(1, 3, mDropButton); - place(8, 3, mSplitButton); - place(9, 3, mShopButton); - place(10, 3, mOutfitButton); + place(8, 2, mSplitButton); + place(8, 3, mShopButton); + place(9, 3, mOutfitButton); + place(10, 3, mEquipmentButton); updateWeight(); } @@ -274,6 +277,15 @@ void InventoryWindow::action(const gcn::ActionEvent &event) shopWindow->requestMoveToTop(); } } + else if (event.getId() == "equipment") + { + if (equipmentWindow) + { + equipmentWindow->setVisible(!equipmentWindow->isVisible()); + if (equipmentWindow->isVisible()) + equipmentWindow->requestMoveToTop(); + } + } else if (event.getId() == "close") { close(); diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 0aecaa81c..7829c40b6 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -162,8 +162,8 @@ class InventoryWindow : public Window, std::string mWeight, mSlots; - gcn::Button *mUseButton, *mDropButton, - *mSplitButton, *mOutfitButton, *mShopButton, + gcn::Button *mUseButton, *mDropButton, *mSplitButton, + *mOutfitButton, *mShopButton, *mEquipmentButton, *mStoreButton, *mRetrieveButton, *mCloseButton; gcn::Label *mWeightLabel, *mSlotsLabel, *mFilterLabel; |