summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-24 23:10:51 -0600
committerJared Adams <jaxad0127@gmail.com>2010-03-25 11:31:55 -0600
commitbf6cb46d9b06b06470efd5ad3ebae7e274f6906f (patch)
tree281cdf6d017477f07e02e73acef175f937c18eed /src/gui/inventorywindow.h
parent83077364f8b67fb9fc57e8b04a1feff0e243848d (diff)
downloadmana-bf6cb46d9b06b06470efd5ad3ebae7e274f6906f.tar.gz
mana-bf6cb46d9b06b06470efd5ad3ebae7e274f6906f.tar.bz2
mana-bf6cb46d9b06b06470efd5ad3ebae7e274f6906f.tar.xz
mana-bf6cb46d9b06b06470efd5ad3ebae7e274f6906f.zip
Eliminate the logic methods from InventoryWindow and StorageWindow
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;
};