summaryrefslogtreecommitdiff
path: root/src/gui/inventory.h
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-02-06 11:31:42 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-02-06 11:31:42 +0000
commit27a3b5eb022c8f2efffa061701c0162fc1ab5d0b (patch)
tree2dee18756a4650263d78b1f85a6a9787c04fa024 /src/gui/inventory.h
parent8dd53f61516293347c2eb6641bf874b75d6e6f81 (diff)
downloadmana-client-27a3b5eb022c8f2efffa061701c0162fc1ab5d0b.tar.gz
mana-client-27a3b5eb022c8f2efffa061701c0162fc1ab5d0b.tar.bz2
mana-client-27a3b5eb022c8f2efffa061701c0162fc1ab5d0b.tar.xz
mana-client-27a3b5eb022c8f2efffa061701c0162fc1ab5d0b.zip
Fixing inventory (still needed to add a proper way to choose items, now creating a item widget)
Diffstat (limited to 'src/gui/inventory.h')
-rw-r--r--src/gui/inventory.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/inventory.h b/src/gui/inventory.h
index 784918cb..4248bfdb 100644
--- a/src/gui/inventory.h
+++ b/src/gui/inventory.h
@@ -21,15 +21,16 @@
* $Id$
*/
-#ifndef _INVENTORY_H
-#define _INVENTORY_H
+#ifndef _TMW_INVENTORY_H
+#define _TMW_INVENTORY_H
#include "../log.h"
#include "../net/network.h"
#include "../graphic/spriteset.h"
+#include "gui.h"
#include "window.h"
-#define INVENTORY_SIZE 100
+#define INVENTORY_SIZE 12
struct ITEM_HOLDER { // the holder of a item
int id; // the id of the item
@@ -42,7 +43,7 @@ struct ITEM_HOLDER { // the holder of a item
*
* \ingroup GUI
*/
-class InventoryWindow : public Window {
+class InventoryWindow : public Window, gcn::ActionListener {
public:
/**
* Constructor.
@@ -78,15 +79,26 @@ class InventoryWindow : public Window {
* Increase quantity of an item.
*/
int increaseQuantity(int index, int quantity);
+
+ /**
+ * Called when receiving actions from the widgets.
+ */
+ void action(const std::string& eventId);
+
+ /**
+ * Handles mouse events
+ */
+ void mousePress(int mx, int my, int button);
ITEM_HOLDER items[INVENTORY_SIZE]; /**< this is the holder of items */
private:
+ gcn::Button *useButton, *dropButton;
int useItem(int index, int id);
int dropItem(int index, int amunt);
Spriteset *itemset;
- int itemMeny, itemMeny_x, itemMeny_y, itemMeny_i;
+ int selectedItem;
};
#endif