diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-02-25 18:09:30 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-02-25 18:09:30 +0000 |
commit | d855488fdc9830c00ed3ce71532cfd52316988f1 (patch) | |
tree | a241ce6d0da88148e9b9024ec8adbe16148aff0f /src/gui | |
parent | 7369c775464aa9eae7a98bb935442b2fa2992f8e (diff) | |
download | mana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.gz mana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.bz2 mana-d855488fdc9830c00ed3ce71532cfd52316988f1.tar.xz mana-d855488fdc9830c00ed3ce71532cfd52316988f1.zip |
Fixing equipment and shops according to the new server script
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buy.cpp | 3 | ||||
-rw-r--r-- | src/gui/equipment.cpp | 8 | ||||
-rw-r--r-- | src/gui/inventory.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/sell.cpp | 3 | ||||
-rw-r--r-- | src/gui/shop.cpp | 98 |
6 files changed, 108 insertions, 8 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 059ba4e8..ab350363 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -44,6 +44,7 @@ BuyDialog::BuyDialog(): setSize(260, 175); scrollArea->setDimension(gcn::Rectangle(5, 5, 250, 110)); + itemList->setDimension(gcn::Rectangle(5, 5, 240, 110)); slider->setDimension(gcn::Rectangle(5, 120, 200, 10)); quantityLabel->setPosition(215, 120); moneyLabel->setPosition(5, 135); @@ -99,7 +100,7 @@ void BuyDialog::addItem(short id, int price) { ITEM_SHOP item_shop; - if (id - 501 >= 0 && id - 501 <= 11) { + if (id >= 501 && id <= 2301) { sprintf(item_shop.name, "%s %i gp", item_db[id - 501], price); } else { diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp index ccc4d403..c7507475 100644 --- a/src/gui/equipment.cpp +++ b/src/gui/equipment.cpp @@ -29,7 +29,7 @@ EquipmentWindow::EquipmentWindow(): Window("Equipment") { - setSize(70, 200); + setSize(60, 200); setPosition(40, 40); ResourceManager *resman = ResourceManager::getInstance(); @@ -54,11 +54,13 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) // Draw window graphics Window::draw(graphics); - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 8; i++) { if (equipments[i] > 0) { itemset->spriteset[equipments[i] - 501]->draw(screen, - x + 20, y + 24 * i); + x + 22, y + 24 * i + 20); } + graphics->setColor(gcn::Color(0, 0, 0)); + graphics->drawRectangle(gcn::Rectangle(22, 24 * i + 20, 20, 20)); } } diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp index d891db48..23520ba2 100644 --- a/src/gui/inventory.cpp +++ b/src/gui/inventory.cpp @@ -32,7 +32,7 @@ InventoryWindow::InventoryWindow(): Window("Inventory") { - setSize(322, 80); + setSize(322, 100); useButton = new Button("Use"); useButton->setPosition(20, 50); dropButton = new Button("Drop"); diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 195f9188..49a6278b 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -60,7 +60,7 @@ void ItemContainer::draw(gcn::Graphics* graphics) for (int i = 0; i < INVENTORY_SIZE; i++) { if (items[i].quantity > 0) { - if (items[i].id >= 501 && items[i].id <= 2301) { + if (items[i].id >= 501 && items[i].id <= 1202) { itemset->spriteset[items[i].id - 501]->draw(screen, x + 24 * i, y + 2); diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index d8e6eb02..bcb72590 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -43,6 +43,7 @@ SellDialog::SellDialog(): setSize(260, 175); scrollArea->setDimension(gcn::Rectangle(5, 5, 250, 110)); + itemList->setDimension(gcn::Rectangle(5, 5, 240, 110)); slider->setDimension(gcn::Rectangle(5, 120, 200, 10)); quantityLabel->setPosition(215, 120); okButton->setPosition(180, 145); @@ -89,7 +90,7 @@ void SellDialog::addItem(short index, int price) int id = inventoryWindow->items->getId(index); ITEM_SHOP item_shop; - if (id >= 501 && id <= 511) { + if (id >= 501 && id <= 2301) { sprintf(item_shop.name, "%s %i gp", item_db[id - 501], price); } else { diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index 77e33ee0..7509d480 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -23,6 +23,8 @@ #include "shop.h" +// TODO: replace it with item database + char *item_db[] = { "Cactus Drink", "Cactus potion", @@ -34,5 +36,99 @@ char *item_db[] = { "Xmas Cake", "Chocolate", "Candy", - "Santa Hat" + "Santa Hat", + + "","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 601 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 701 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 801 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 901 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 1001 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 1101 + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + + // 1201 + "Knife","Cotton Shirt","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", + "","","","","","","","","","", }; |