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.h59
1 files changed, 43 insertions, 16 deletions
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index 9d342c83..6a51c66d 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -1,38 +1,39 @@
/*
* The Mana World
- * Copyright 2004 The Mana World Development Team
+ * Copyright (C) 2004 The Mana World Development Team
*
* This file is part of The Mana World.
*
- * The Mana World is free software; you can redistribute it and/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
- * The Mana World is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with The Mana World; if not, write to the Free Software
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _TMW_INVENTORYWINDOW_H
-#define _TMW_INVENTORYWINDOW_H
+#ifndef INVENTORYWINDOW_H
+#define INVENTORYWINDOW_H
#include <guichan/actionlistener.hpp>
-#include <guichan/keylistener.hpp>
#include <guichan/selectionlistener.hpp>
-#include <guichan/widgets/checkbox.hpp>
+#include <guichan/keylistener.hpp>
#include "window.h"
-#include "../guichanfwd.h"
+#include "../localplayer.h"
class Item;
class ItemContainer;
+class ProgressBar;
+class TextBox;
/**
* Inventory dialog.
@@ -48,7 +49,16 @@ class InventoryWindow : public Window,
/**
* Constructor.
*/
- InventoryWindow();
+#ifdef TMWSERV_SUPPORT
+ InventoryWindow(int invSize = (INVENTORY_SIZE));
+#else
+ InventoryWindow(int invSize = (INVENTORY_SIZE - 2));
+#endif
+
+ /**
+ * Destructor.
+ */
+ ~InventoryWindow();
/**
* Logic (updates buttons and weight information).
@@ -61,10 +71,16 @@ class InventoryWindow : public Window,
void action(const gcn::ActionEvent &event);
/**
+ * Returns the selected item.
+ */
+ Item* getSelectedItem() const;
+
+ /**
* Handles the mouse clicks.
*/
void mouseClicked(gcn::MouseEvent &event);
+#ifdef TMWSERV_SUPPORT
/**
* Handles the key presses.
*/
@@ -74,8 +90,7 @@ class InventoryWindow : public Window,
* Handles the key releases.
*/
void keyReleased(gcn::KeyEvent &event);
-
- Item* getItem();
+#endif
/**
* Updates labels to currently selected item.
@@ -87,13 +102,25 @@ class InventoryWindow : public Window,
ItemContainer *mItems;
- /**< Use, Drop, Split Item Buttons. */
- gcn::Button *mUseButton, *mDropButton, *mSplitButton;
-
+ std::string mWeight;
+ std::string mSlots;
+ std::string mUsedSlots;
+ int mTotalWeight, mMaxWeight;
+ gcn::Button *mUseButton;
+ gcn::Button *mDropButton;
+#ifdef TMWSERV_SUPPORT
+ gcn::Button *mSplitButton;
+#endif
gcn::ScrollArea *mInvenScroll; /**< Inventory Scroll Area. */
+ gcn::Label *mWeightLabel;
+ gcn::Label *mSlotsLabel;
- bool mSplit;
+ ProgressBar *mWeightBar;
+ ProgressBar *mSlotsBar;
+ int mMaxSlots;
+
+ bool mSplit;
bool mItemDesc;
};