diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-28 11:21:47 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-28 11:21:47 +0000 |
commit | f8a90f4964ad694e1d6166f82b51897629df487c (patch) | |
tree | 53686556cefa059dda6da3cc8315000f3d3c3744 | |
parent | 8063086435d6ce9ec848e9962287cd6c97001ca4 (diff) | |
download | mana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.gz mana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.bz2 mana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.xz mana-f8a90f4964ad694e1d6166f82b51897629df487c.zip |
Inventory dialog is also not a dialog.
-rw-r--r-- | src/game.cpp | 14 | ||||
-rw-r--r-- | src/graphic/graphic.cpp | 8 | ||||
-rw-r--r-- | src/graphic/graphic.h | 2 | ||||
-rw-r--r-- | src/gui/inventory.cpp | 18 | ||||
-rw-r--r-- | src/gui/inventory.h | 6 | ||||
-rw-r--r-- | src/gui/shop.cpp | 4 |
6 files changed, 26 insertions, 26 deletions
diff --git a/src/game.cpp b/src/game.cpp index 2438cc1e..e378778c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -288,7 +288,7 @@ void do_input() { show_skill_dialog = !show_skill_dialog; action_time = false; } else if(key[KEY_I]) { - inventoryDialog->setVisible(!inventoryDialog->isVisible()); + inventoryWindow->setVisible(!inventoryWindow->isVisible()); action_time = false; } else if(key[KEY_K]) { show_skill_list_dialog = !show_skill_dialog; @@ -536,7 +536,7 @@ void do_parse() { // Get the items case 0x01ee: for(int loop=0;loop<(RFIFOW(2)-4)/18;loop++) { - inventoryDialog->addItem(RFIFOW(4 + loop * 18), + inventoryWindow->addItem(RFIFOW(4 + loop * 18), RFIFOW(4 + loop * 18 + 2), RFIFOW(4 + loop * 18 + 6)); } break; @@ -545,7 +545,7 @@ void do_parse() { // index RFIFOW(2) // succes or not RFIFOB(6); //if (RFIFOB(6)) - // inventoryDialog->addItem(RFIFOW(2), RFIFOW(4)); + // inventoryWindow->addItem(RFIFOW(2), RFIFOW(4)); break; // Warp case 0x0091: @@ -788,16 +788,16 @@ void do_parse() { if(RFIFOB(22)>0) chatlog.chat_log("Unable to pick up item", BY_SERVER, font); else - inventoryDialog->addItem(RFIFOW(2), RFIFOW(6), RFIFOW(4)); + inventoryWindow->addItem(RFIFOW(2), RFIFOW(6), RFIFOW(4)); break; // Remove item to inventory after you sold it case 0x00af: printf("sell %i\n", -RFIFOW(4)); - inventoryDialog->increaseQuantity(RFIFOW(2), -RFIFOW(4)); + inventoryWindow->increaseQuantity(RFIFOW(2), -RFIFOW(4)); break; // Use an item case 0x01c8: - inventoryDialog->changeQuantity(RFIFOW(2), RFIFOW(10)); + inventoryWindow->changeQuantity(RFIFOW(2), RFIFOW(10)); break; // ?? case 0x0119: @@ -871,7 +871,7 @@ void do_parse() { break; case 0x00a4: for (int i = 0; i < (RFIFOW(2) - 4) / 20; i++) - inventoryDialog->addItem(RFIFOW(4 + 20 * i), RFIFOW(6 + 20 * i), 1); + inventoryWindow->addItem(RFIFOW(4 + 20 * i), RFIFOW(6 + 20 * i), 1); break; // Manage non implemented packets diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp index 547a6256..736677e6 100644 --- a/src/graphic/graphic.cpp +++ b/src/graphic/graphic.cpp @@ -56,7 +56,7 @@ gcn::TextField *chatInput; StatusWindow *statusWindow; BuyDialog *buyDialog; BuySellDialog *buySellDialog; -InventoryDialog *inventoryDialog; +InventoryWindow *inventoryWindow; void ChatListener::action(const std::string& eventId) { @@ -222,9 +222,9 @@ void init_graphic() { buySellDialog = new BuySellDialog(guiTop, new BuySellListener()); buySellDialog->setVisible(false); - inventoryDialog = new InventoryDialog(guiTop); - inventoryDialog->setVisible(false); - inventoryDialog->setPosition(100, 100); + inventoryWindow = new InventoryWindow(guiTop); + inventoryWindow->setVisible(false); + inventoryWindow->setPosition(100, 100); npc_player = init_dialog(npc_dialog, -1); position_dialog(npc_dialog, 300, 200); diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h index 17cc3d5c..dd42a4ad 100644 --- a/src/graphic/graphic.h +++ b/src/graphic/graphic.h @@ -53,7 +53,7 @@ extern char npc_button[10]; extern StatusWindow *statusWindow; extern BuyDialog *buyDialog; extern BuySellDialog *buySellDialog; -extern InventoryDialog *inventoryDialog; +extern InventoryWindow *inventoryWindow; // The action listener for the chat field class ChatListener : public gcn::ActionListener { diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp index f5479d29..d506d8ed 100644 --- a/src/gui/inventory.cpp +++ b/src/gui/inventory.cpp @@ -24,7 +24,7 @@ #include "inventory.h" #include <sstream> -InventoryDialog::InventoryDialog(gcn::Container *parent): +InventoryWindow::InventoryWindow(gcn::Container *parent): Window(parent, "Inventory") { setSize(322, 60); @@ -37,11 +37,11 @@ InventoryDialog::InventoryDialog(gcn::Container *parent): } } -InventoryDialog::~InventoryDialog() +InventoryWindow::~InventoryWindow() { } -void InventoryDialog::draw(gcn::Graphics *graphics) +void InventoryWindow::draw(gcn::Graphics *graphics) { int x, y; getAbsolutePosition(x, y); @@ -121,13 +121,13 @@ void InventoryDialog::draw(gcn::Graphics *graphics) } -int InventoryDialog::addItem(int index, int id, int quantity) { +int InventoryWindow::addItem(int index, int id, int quantity) { items[index].id = id; items[index].quantity += quantity; return 0; } -int InventoryDialog::removeItem(int id) { +int InventoryWindow::removeItem(int id) { for (int i = 0; i < INVENTORY_SIZE; i++) { if (items[i].id == id) { items[i].id = -1; @@ -137,17 +137,17 @@ int InventoryDialog::removeItem(int id) { return 0; } -int InventoryDialog::changeQuantity(int index, int quantity) { +int InventoryWindow::changeQuantity(int index, int quantity) { items[index].quantity = quantity; return 0; } -int InventoryDialog::increaseQuantity(int index, int quantity) { +int InventoryWindow::increaseQuantity(int index, int quantity) { items[index].quantity += quantity; return 0; } -int InventoryDialog::useItem(int index, int id) { +int InventoryWindow::useItem(int index, int id) { WFIFOW(0) = net_w_value(0x00a7); WFIFOW(2) = net_w_value(index); WFIFOL(4) = net_l_value(id); @@ -157,7 +157,7 @@ int InventoryDialog::useItem(int index, int id) { return 0; } -int InventoryDialog::dropItem(int index, int amunt) { +int InventoryWindow::dropItem(int index, int amunt) { WFIFOW(0) = net_w_value(0x00a7); WFIFOW(2) = net_w_value(index); WFIFOL(4) = net_l_value(amunt); diff --git a/src/gui/inventory.h b/src/gui/inventory.h index d21f4ebd..a89578a3 100644 --- a/src/gui/inventory.h +++ b/src/gui/inventory.h @@ -50,10 +50,10 @@ struct ITEM_HOLDER { // the holder of a item * * \ingroup GUI */ -class InventoryDialog : public Window { +class InventoryWindow : public Window { public: - InventoryDialog(gcn::Container *parent); - ~InventoryDialog(); + InventoryWindow(gcn::Container *parent); + ~InventoryWindow(); /** * Draws the inventory window. diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index a7a9e358..4cdfd9f4 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -68,7 +68,7 @@ void add_buy_item(short id, int price) { } void add_sell_item(short index, int price) { - int id = inventoryDialog->items[index].id; + int id = inventoryWindow->items[index].id; ITEM_SHOP *item_shop = (ITEM_SHOP *)malloc(sizeof(ITEM_SHOP)); if (id >= 501 && id <= 511) sprintf(item_shop->name, "%s %i gp", item_db[id-501], price); @@ -77,7 +77,7 @@ void add_sell_item(short index, int price) { item_shop->price = price; item_shop->index = index; item_shop->id = id; - item_shop->quantity = inventoryDialog->items[index].quantity; + item_shop->quantity = inventoryWindow->items[index].quantity; item_shop->next = NULL; if (shop == NULL) shop = item_shop; |