diff options
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index bde8906b..aa67adab 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -24,6 +24,7 @@ #include "sell.h" #include <cassert> +#include <sstream> #include <guichan/widgets/label.hpp> @@ -42,7 +43,6 @@ #include "../net/messageout.h" #include "../net/protocol.h" -#include "../utils/tostring.h" SellDialog::SellDialog(Network *network): Window("Sell"), @@ -141,8 +141,11 @@ void SellDialog::addItem(Item *item, int price) return; ITEM_SHOP item_shop; + std::stringstream ss; - item_shop.name = item->getInfo()->getName() + " " + toString(price) + " GP"; + ss << item->getInfo()->getName() << " " << price << " GP"; + + item_shop.name = ss.str(); item_shop.price = price; item_shop.index = item->getInvIndex(); item_shop.id = item->getId(); @@ -237,12 +240,15 @@ void SellDialog::action(const std::string& eventId) // If anything changed, we need to update the buttons and labels if (updateButtonsAndLabels) { + std::stringstream oss; + // Update labels - mQuantityLabel->setCaption(toString(mAmountItems)); + oss << mAmountItems; + mQuantityLabel->setCaption(oss.str()); mQuantityLabel->adjustSize(); - - int price = mAmountItems * mShopItems->at(selectedItem).price; - mMoneyLabel->setCaption("Price: " + toString(price)); + oss.str(""); + oss << "Price: " << mAmountItems * mShopItems->at(selectedItem).price; + mMoneyLabel->setCaption(oss.str()); mMoneyLabel->adjustSize(); // Update Buttons |