summaryrefslogtreecommitdiff
path: root/src/gui/inventory.h
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-09-30 16:19:04 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-09-30 16:19:04 +0000
commit9353cfbee08ae3e130e2e9dcfb0942ff465a8329 (patch)
treef5a8df60d604a5a03d1b19e464c1fa912cfc154a /src/gui/inventory.h
parent41c001e2eeda8fede8dcc79339c1993f99fcffda (diff)
downloadmana-9353cfbee08ae3e130e2e9dcfb0942ff465a8329.tar.gz
mana-9353cfbee08ae3e130e2e9dcfb0942ff465a8329.tar.bz2
mana-9353cfbee08ae3e130e2e9dcfb0942ff465a8329.tar.xz
mana-9353cfbee08ae3e130e2e9dcfb0942ff465a8329.zip
*** empty log message ***
Diffstat (limited to 'src/gui/inventory.h')
-rw-r--r--src/gui/inventory.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/gui/inventory.h b/src/gui/inventory.h
index e88094ed..61ec9e7b 100644
--- a/src/gui/inventory.h
+++ b/src/gui/inventory.h
@@ -31,47 +31,39 @@
#define _INVENTORY_H
#include <allegro.h>
-/*#ifdef WIN32
-#include <winalleg.h>
-#endif*/
#include "../main.h"
#include "../game.h"
#include "../log.h"
#include "../net/network.h"
#include "gui.h"
+#define INVENTORY_SIZE 10
+
struct itemHolder { // the holder of a item
- int flag; // don't really know why I use this :)
- int itemIDNum; // the id of the item
- int num; // number of items
- int xpos, ypos; // where am I?
+ int id; // the id of the item
+ int quantity; // number of items
+ //int index; // item position
};
-
-
class TmwInventory{
public:
TmwInventory() {};
~TmwInventory() {};
- void create(int tempxpos, int tempypos); // create the window
+ void create(int x, int y); // create the window
void draw(BITMAP *); // draw the window (if areDisplaying != 0 )
- void show(int val); // choose between showing and not showing the window
+ void show(bool val); // choose between showing and not showing the window
void toggle() { if(areDisplaying){show(0);}else{show(1);} }
//API
- int addItem(int idnum, int antal); //add a item
- int rmItem(int idnum); //remove a item
+ int add_item(int index, int id, int quantity); // add a item
+ int remove_item(int id); // remove a item
int changeNum(int idnum, int antal); // change number of a item
int useItem(int idnum);
//END API
private:
- BITMAP * backgroundSmall;
- BITMAP * backgroundBig;
- BITMAP * title;
- BITMAP * empty;
- BITMAP * selected;
- itemHolder items[10][10]; // this is the test holder of items
+ itemHolder items[INVENTORY_SIZE]; // this is the holder of items
DATAFILE *itemset;
+ bool show_inventory;
int ghostX, ghostY, ghostID, ghostOldIDX,ghostOldIDY; //info needed when moving item
int dragingItem, lastSelectedX,lastSelectedY; //info needed when moving item
int areDisplaying, dragingWindow;