diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-28 22:15:14 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-28 22:15:14 +0000 |
commit | 208dcc64cdb4905e637228e23213b0d3b63c82a9 (patch) | |
tree | 450b46e11702d7980375ae5ef817456ec033ceb9 | |
parent | d9b0d3ec1d3af85bfe35a7dd5d4d2ee2a9fb8331 (diff) | |
download | mana-client-208dcc64cdb4905e637228e23213b0d3b63c82a9.tar.gz mana-client-208dcc64cdb4905e637228e23213b0d3b63c82a9.tar.bz2 mana-client-208dcc64cdb4905e637228e23213b0d3b63c82a9.tar.xz mana-client-208dcc64cdb4905e637228e23213b0d3b63c82a9.zip |
A few cleanups and small fix to sell dialog.
-rw-r--r-- | src/game.cpp | 1 | ||||
-rw-r--r-- | src/gui/sell.cpp | 3 | ||||
-rw-r--r-- | src/gui/shop.cpp | 22 | ||||
-rw-r--r-- | src/gui/shop.h | 1 |
4 files changed, 3 insertions, 24 deletions
diff --git a/src/game.cpp b/src/game.cpp index 94abec3a..21c5aa3a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -766,7 +766,6 @@ void do_parse() { for (int k = 0; k < n_items; k++) { sellDialog->addItem( RFIFOW(4 + 10 * k), RFIFOL(4 + 10 * k + 2)); - //add_sell_item(RFIFOW(4 + 10 * k), RFIFOL(4 + 10 * k + 2)); } } else { diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index f807d1c4..4dc210a4 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -77,6 +77,9 @@ SellDialog::~SellDialog() void SellDialog::reset() { shopInventory.clear(); + slider->setValue(0.0); + quantityLabel->setCaption("0"); + quantityLabel->adjustSize(); } void SellDialog::addItem(short index, int price) diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index c7bf5967..cc9d80ab 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -48,28 +48,6 @@ char *shop_list(int index, int *list_size) { } } -void add_sell_item(short index, int price) { - 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); - else - sprintf(item_shop->name, "Unknown item %i gp", price); - item_shop->price = price; - item_shop->index = index; - item_shop->id = id; - item_shop->quantity = inventoryWindow->items[index].quantity; - item_shop->next = NULL; - if (shop == NULL) - shop = item_shop; - else { - ITEM_SHOP *temp = shop; - while(temp->next) - temp = temp->next; - temp->next = item_shop; - } -} - void close_shop() { ITEM_SHOP *temp, *next; temp = shop; diff --git a/src/gui/shop.h b/src/gui/shop.h index 2a1af602..c223ef7c 100644 --- a/src/gui/shop.h +++ b/src/gui/shop.h @@ -45,7 +45,6 @@ extern char itemCurrenyQ[10]; extern char *item_db[]; char *shop_list(int index, int *list_size); -void add_sell_item(short index, int price); void changeQ(void *dp3, int d2); void close_shop(); short get_item_id(int index); |