From 4e97da8e138b21a5f5bea75e6a8d3211e4f28594 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 24 Mar 2016 23:29:04 +0300 Subject: Add enum for item types. --- src/gui/windows/shopwindow.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/gui/windows/shopwindow.cpp') diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 679bbc47f..eb07c90dc 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -562,12 +562,20 @@ void ShopWindow::loadList() if (tokens[1] && tokens[2]) { mBuyShopItems->addItem( - tokens[0], 0, ItemColor_one, tokens[1], tokens[2]); + tokens[0], + ItemType::Unknown, + ItemColor_one, + tokens[1], + tokens[2]); } if (tokens[3] && tokens[4]) { mSellShopItems->addItem( - tokens[0], 0, ItemColor_one, tokens[3], tokens[4]); + tokens[0], + ItemType::Unknown, + ItemColor_one, + tokens[3], + tokens[4]); } } } @@ -855,7 +863,13 @@ void ShopWindow::showList(const std::string &nick, std::string data) int amount = decodeStr(data.substr(f + 6, 3)); // +++ need impliment colors? if (buyDialog && amount > 0) - buyDialog->addItem(id, 0, ItemColor_one, amount, price); + { + buyDialog->addItem(id, + ItemType::Unknown, + ItemColor_one, + amount, + price); + } if (sellDialog) { // +++ need support for colors @@ -870,7 +884,7 @@ void ShopWindow::showList(const std::string &nick, std::string data) amount = 0; } ShopItem *const shopItem = sellDialog->addItem(id, - 0, + ItemType::Unknown, ItemColor_one, amount, price); @@ -940,7 +954,12 @@ void ShopWindow::processRequest(const std::string &nick, std::string data, delete mTradeItem; // +++ need impliment colors? - mTradeItem = new ShopItem(-1, id, 0, ItemColor_one, amount, price); + mTradeItem = new ShopItem(-1, + id, + ItemType::Unknown, + ItemColor_one, + amount, + price); if (mode == BUY) { -- cgit v1.2.3-60-g2f50