summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/inventorywindow.h')
-rw-r--r--src/gui/inventorywindow.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index fdc5e55a..cfea130f 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -47,14 +47,14 @@ class TextBox;
class InventoryWindow : public Window,
public gcn::ActionListener,
public gcn::KeyListener,
- public gcn::SelectionListener
+ public gcn::SelectionListener,
+ public InventoryListener
{
public:
/**
* Constructor.
*/
- InventoryWindow(int invSize = Net::getInventoryHandler()
- ->getSize(Net::InventoryHandler::INVENTORY));
+ InventoryWindow();
/**
* Destructor.
@@ -62,11 +62,6 @@ class InventoryWindow : public Window,
~InventoryWindow();
/**
- * Logic (updates buttons and weight information).
- */
- void logic();
-
- /**
* Called when receiving actions from the widgets.
*/
void action(const gcn::ActionEvent &event);
@@ -100,17 +95,20 @@ class InventoryWindow : public Window,
* Sets whether the split button should be shown.
*/
void setSplitAllowed(bool allowed);
+
+ /**
+ * Updates the weight bar.
+ */
+ void updateWeight();
- private:
- void updateButtons(); /**< Updates button states. */
+ void slotsChanged(Inventory* inventory);
+ private:
ItemContainer *mItems;
std::string mWeight;
std::string mSlots;
- int mUsedSlots;
- int mTotalWeight;
- int mMaxWeight;
+
gcn::Button *mUseButton;
gcn::Button *mDropButton;
gcn::Button *mSplitButton;
@@ -121,8 +119,6 @@ class InventoryWindow : public Window,
ProgressBar *mWeightBar;
ProgressBar *mSlotsBar;
- int mMaxSlots;
-
bool mSplit;
bool mItemDesc;
};