diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-26 19:44:58 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-26 19:44:58 +0000 |
commit | 800f8e6070f10908c446147b96d5e1424f55c729 (patch) | |
tree | c043d03e5a0294174696a3a6d23ecc12a2acdb80 /src/gui/inventory.h | |
parent | a94d3a14dd0d891cf05ea0c7a4d1613560fd96c5 (diff) | |
download | mana-800f8e6070f10908c446147b96d5e1424f55c729.tar.gz mana-800f8e6070f10908c446147b96d5e1424f55c729.tar.bz2 mana-800f8e6070f10908c446147b96d5e1424f55c729.tar.xz mana-800f8e6070f10908c446147b96d5e1424f55c729.zip |
Ported the inventory dialog over to Guichan. For the moment it is not
possible to delete or use items.
Diffstat (limited to 'src/gui/inventory.h')
-rw-r--r-- | src/gui/inventory.h | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/src/gui/inventory.h b/src/gui/inventory.h index a83a1f80..7c1740a9 100644 --- a/src/gui/inventory.h +++ b/src/gui/inventory.h @@ -32,68 +32,59 @@ #include "../log.h" #include "../net/network.h" #include "gui.h" +#include "window.h" #define INVENTORY_SIZE 100 -struct itemHolder { // the holder of a item +struct ITEM_HOLDER { // the holder of a item int id; // the id of the item int quantity; // number of items //int index; // item position }; -class TmwInventory { - public: - TmwInventory(); - ~TmwInventory(); - - /** - * Initialize inventory and create the window. - */ - void create(int x, int y); - - /** - * Draw inventory window. - */ - void draw(BITMAP *); - /** - * Sets if inventory is visible. - */ - void setVisible(bool visible); +/** + * Inventory dialog. + * + * \ingroup GUI + */ +class InventoryDialog : public Window { + public: + InventoryDialog(gcn::Container *parent); + ~InventoryDialog(); /** - * Returns visibility of inventory. + * Draws the inventory window. */ - bool isVisible(); + void draw(gcn::Graphics *graphics); /** * Add an item the inventory. */ - int add_item(int index, int id, int quantity); + int addItem(int index, int id, int quantity); /** * Remove a item from the inventory. */ - int remove_item(int id); + int removeItem(int id); /** * Change quantity of an item. */ - int change_quantity(int index, int quantity); + int changeQuantity(int index, int quantity); /** * Increase quantity of an item */ - int increase_quantity(int index, int quantity); + int increaseQuantity(int index, int quantity); - int use_item(int index, int id); - int quantityForIndex(int index) { return items[index].quantity; } - int drop_item(int index, int amunt); + ITEM_HOLDER items[INVENTORY_SIZE]; /**< this is the holder of items */ - itemHolder items[INVENTORY_SIZE]; /**< this is the holder of items */ private: + int useItem(int index, int id); + int dropItem(int index, int amunt); + DATAFILE *itemset; - bool show_inventory; int itemMeny, itemMeny_x, itemMeny_y, itemMeny_i; }; |