summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-26 19:44:58 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-26 19:44:58 +0000
commit800f8e6070f10908c446147b96d5e1424f55c729 (patch)
treec043d03e5a0294174696a3a6d23ecc12a2acdb80 /src/game.cpp
parenta94d3a14dd0d891cf05ea0c7a4d1613560fd96c5 (diff)
downloadmana-client-800f8e6070f10908c446147b96d5e1424f55c729.tar.gz
mana-client-800f8e6070f10908c446147b96d5e1424f55c729.tar.bz2
mana-client-800f8e6070f10908c446147b96d5e1424f55c729.tar.xz
mana-client-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/game.cpp')
-rw-r--r--src/game.cpp24
1 files changed, 13 insertions, 11 deletions
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