From 800f8e6070f10908c446147b96d5e1424f55c729 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 26 Dec 2004 19:44:58 +0000 Subject: Ported the inventory dialog over to Guichan. For the moment it is not possible to delete or use items. --- src/game.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 64336157..cd076611 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -287,7 +287,7 @@ void do_input() { show_skill_dialog = !show_skill_dialog; action_time = false; } else if(key[KEY_I]) { - inventory.setVisible(!inventory.isVisible()); + inventoryDialog->setVisible(!inventoryDialog->isVisible()); action_time = false; } else if(key[KEY_K]) { show_skill_list_dialog = !show_skill_dialog; @@ -531,14 +531,16 @@ void do_parse() { break; //Get the items case 0x01ee: - for(int loop=0;loop<(RFIFOW(2)-4)/18;loop++) { - inventory.add_item(RFIFOW(4+loop*18), RFIFOW(4+loop*18+2), RFIFOW(4+loop*18+6)); } + for (int loop = 0; loop < (RFIFOW(2) - 4) / 18; loop++) { + inventoryDialog->addItem(RFIFOW(4 + loop * 18), + RFIFOW(4 + loop * 18 + 2), RFIFOW(4 + loop * 18 + 6)); + } break; case 0x00a8: // could I use the item? // index RFIFOW(2) // succes or not RFIFOB(6); - //if(RFIFOB(6)) - // inventory.add_item(RFIFOW(2),RFIFOW(4)); + //if (RFIFOB(6)) + // inventoryDialog->addItem(RFIFOW(2), RFIFOW(4)); break; // Warp case 0x0091: @@ -776,16 +778,16 @@ void do_parse() { if(RFIFOB(22)>0) chatlog.chat_log("Unable to pick up item", BY_SERVER, font); else - inventory.add_item(RFIFOW(2), RFIFOW(6), RFIFOW(4)); + inventoryDialog->addItem(RFIFOW(2), RFIFOW(6), RFIFOW(4)); break; // Remove item to inventory after you sold it case 0x00af: - printf("sell %i\n",-RFIFOW(4)); - inventory.increase_quantity(RFIFOW(2), -RFIFOW(4)); + printf("sell %i\n", -RFIFOW(4)); + inventoryDialog->increaseQuantity(RFIFOW(2), -RFIFOW(4)); break; // Use an item case 0x01c8: - inventory.change_quantity(RFIFOW(2), RFIFOW(10)); + inventoryDialog->changeQuantity(RFIFOW(2), RFIFOW(10)); break; // ?? case 0x0119: @@ -858,8 +860,8 @@ void do_parse() { } break; case 0x00a4: - for(int i=0;i<(RFIFOW(2)-4)/20;i++) - inventory.add_item(RFIFOW(4+20*i), RFIFOW(6+20*i), 1); + for (int i = 0; i < (RFIFOW(2) - 4) / 20; i++) + inventoryDialog->addItem(RFIFOW(4 + 20 * i), RFIFOW(6 + 20 * i), 1); break; // Manage non implemented packets -- cgit v1.2.3-70-g09d2