From 9437d4943a8b299b057020ee114b230399965abd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 3 Mar 2011 23:13:07 +0200 Subject: Add colors to buy/sell dialogs. --- src/gui/shopwindow.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/gui/shopwindow.cpp') diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 99a9a6a61..43e05aa70 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -278,7 +278,7 @@ void ShopWindow::addBuyItem(Item *item, int amount, int price) { if (!mBuyShopItems || !item) return; - mBuyShopItems->addItemNoDup(item->getId(), amount, price); + mBuyShopItems->addItemNoDup(item->getId(), item->getColor(), amount, price); updateButtonsAndLabels(); } @@ -286,7 +286,7 @@ void ShopWindow::addSellItem(Item *item, int amount, int price) { if (!mBuyShopItems || !item) return; - mSellShopItems->addItemNoDup(item->getId(), amount, price); + mSellShopItems->addItemNoDup(item->getId(), item->getColor(), amount, price); updateButtonsAndLabels(); } @@ -323,15 +323,16 @@ void ShopWindow::loadList() if (tokens.size() == 5 && tokens[0]) { + //+++ need impliment colors? if (tokens[1] && tokens[2] && mBuyShopItems) { mBuyShopItems->addItem( - tokens[0], tokens[1], tokens[2]); + tokens[0], 1, tokens[1], tokens[2]); } if (tokens[3] && tokens[4] && mSellShopItems) { mSellShopItems->addItem( - tokens[0], tokens[3], tokens[4]); + tokens[0], 1, tokens[3], tokens[4]); } } } @@ -599,8 +600,9 @@ void ShopWindow::showList(const std::string &nick, std::string data) int id = decodeStr(data.substr(f, 2)); int price = decodeStr(data.substr(f + 2, 4)); int amount = decodeStr(data.substr(f + 6, 3)); + //+++ need impliment colors? if (buyDialog && amount > 0) - buyDialog->addItem(id, amount, price); + buyDialog->addItem(id, 1, amount, price); if (sellDialog) { Item *item = inv->findItem(id); @@ -609,9 +611,9 @@ void ShopWindow::showList(const std::string &nick, std::string data) if (item->getQuantity() < amount) amount = item->getQuantity(); if (amount > 0) - sellDialog->addItem(id, amount, price); + sellDialog->addItem(id, 1, amount, price); else - sellDialog->addItem(id, -1, price); + sellDialog->addItem(id, 1, -1, price); } } } @@ -670,7 +672,8 @@ void ShopWindow::processRequest(std::string nick, std::string data, int mode) amount = atoi(part3.c_str()); delete mTradeItem; - mTradeItem = new ShopItem(-1, id, amount, price); + //+++ need impliment colors? + mTradeItem = new ShopItem(-1, id, 1, amount, price); if (mode == BUY) { -- cgit v1.2.3-70-g09d2