summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-28 11:21:47 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-28 11:21:47 +0000
commitf8a90f4964ad694e1d6166f82b51897629df487c (patch)
tree53686556cefa059dda6da3cc8315000f3d3c3744 /src/gui
parent8063086435d6ce9ec848e9962287cd6c97001ca4 (diff)
downloadmana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.gz
mana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.bz2
mana-f8a90f4964ad694e1d6166f82b51897629df487c.tar.xz
mana-f8a90f4964ad694e1d6166f82b51897629df487c.zip
Inventory dialog is also not a dialog.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inventory.cpp18
-rw-r--r--src/gui/inventory.h6
-rw-r--r--src/gui/shop.cpp4
3 files changed, 14 insertions, 14 deletions
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;