summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/inventorywindow.cpp18
-rw-r--r--src/gui/inventorywindow.h4
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;