summaryrefslogtreecommitdiff
path: root/src/gui/inventory.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-09-30 16:51:29 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-09-30 16:51:29 +0000
commit25246c487851b7d113d1fb1d3daf7dc1cdf000c5 (patch)
tree8047797b8daa160ba120bdeea9ad80d79e3a17bc /src/gui/inventory.cpp
parent9353cfbee08ae3e130e2e9dcfb0942ff465a8329 (diff)
downloadmana-25246c487851b7d113d1fb1d3daf7dc1cdf000c5.tar.gz
mana-25246c487851b7d113d1fb1d3daf7dc1cdf000c5.tar.bz2
mana-25246c487851b7d113d1fb1d3daf7dc1cdf000c5.tar.xz
mana-25246c487851b7d113d1fb1d3daf7dc1cdf000c5.zip
*** empty log message ***
Diffstat (limited to 'src/gui/inventory.cpp')
-rw-r--r--src/gui/inventory.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp
index 26f289d2..864adf06 100644
--- a/src/gui/inventory.cpp
+++ b/src/gui/inventory.cpp
@@ -52,7 +52,16 @@ void TmwInventory::create(int tempxpos, int tempypos) {
void TmwInventory::draw(BITMAP * buffer) {
if(show_inventory) {
dialog_message(inventory_dialog,MSG_DRAW,0,0);
- update_dialog(inventory_player);
+ update_dialog(inventory_player);
+ for(int i=0;i<INVENTORY_SIZE;i++) {
+ if(items[i].quantity>0) {
+ if(items[i].id>=501 && items[i].id<=510)
+ masked_blit((BITMAP *)itemset[items[i].id-500].dat, gui_bitmap, 0, 0, inventory_dialog[0].x-90+24*i, inventory_dialog[0].y+26, 22, 22);
+ else
+ masked_blit((BITMAP *)itemset[0].dat, gui_bitmap, 0, 0, inventory_dialog[0].x-90+24*i, inventory_dialog[0].y+26, 22, 22);
+ alfont_textprintf_aa(gui_bitmap, gui_font, inventory_dialog[0].x-90+24*i, inventory_dialog[0].y+44, makecol(0,0,0), "%i", items[i].quantity);
+ }
+ }
}
}
@@ -64,7 +73,7 @@ void TmwInventory::show(bool val) {
/** Add an item the inventory */
int TmwInventory::add_item(int index, int id, int quantity) {
items[index].id = id;
- items[index].quantity = quantity;
+ items[index].quantity += quantity;
return 0;
}
@@ -84,6 +93,12 @@ int TmwInventory::change_quantity(int index, int quantity) {
return 0;
}
+/** Increase quantity of an item */
+int TmwInventory::increase_quantity(int index, int quantity) {
+ items[index].quantity += quantity;
+ return 0;
+}
+
int TmwInventory::useItem(int idnum) {
printf("Use item %i\n",idnum);
WFIFOW(0) = net_w_value(0x00a7);
@@ -92,4 +107,4 @@ int TmwInventory::useItem(int idnum) {
while((out_size>0))flush();
return 0;
-}*/
+}