diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-19 15:09:27 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-19 15:09:27 +0000 |
commit | 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (patch) | |
tree | 5084eaa47d4874a3a573de226f19c4be072e4888 /src/gui/sell.cpp | |
parent | 19d5cc3a6bbbd911361b7e8b956840d0189d4c2b (diff) | |
download | mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.gz mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.bz2 mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.xz mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.zip |
Reverted changeset r2269 (toString) as requested by ElvenProgrammer.
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 |