summaryrefslogtreecommitdiff
path: root/src/gui/buy.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-19 15:09:27 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-19 15:09:27 +0000
commit3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (patch)
tree5084eaa47d4874a3a573de226f19c4be072e4888 /src/gui/buy.cpp
parent19d5cc3a6bbbd911361b7e8b956840d0189d4c2b (diff)
downloadmana-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/buy.cpp')
-rw-r--r--src/gui/buy.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 86bd5413..18542385 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -23,6 +23,8 @@
#include "buy.h"
+#include <sstream>
+
#include <guichan/widgets/label.hpp>
#include "button.h"
@@ -39,8 +41,6 @@
#include "../net/messageout.h"
#include "../net/protocol.h"
-#include "../utils/tostring.h"
-
BuyDialog::BuyDialog(Network *network):
Window("Buy"), mNetwork(network),
@@ -139,8 +139,10 @@ void BuyDialog::reset()
void BuyDialog::addItem(short id, int price)
{
ITEM_SHOP item_shop;
+ std::stringstream ss;
- item_shop.name = itemDb->getItemInfo(id)->getName() + " " + toString(price) + " GP";
+ ss << itemDb->getItemInfo(id)->getName() << " " << price << " GP";
+ item_shop.name = ss.str();
item_shop.price = price;
item_shop.id = id;
@@ -240,17 +242,21 @@ void BuyDialog::action(const std::string& eventId)
// If anything has changed, we have to update the buttons and labels
if (updateButtonsAndLabels) {
+ std::stringstream oss;
+
// Update buttons
mIncreaseButton->setEnabled(mAmountItems < mMaxItems);
mDecreaseButton->setEnabled(mAmountItems > 0);
mBuyButton->setEnabled(mAmountItems > 0);
// 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) + " GP");
+ oss.str("");
+ oss << "Price : " << mAmountItems * mShopItems->at(selectedItem).price << " GP";
+ mMoneyLabel->setCaption(oss.str());
mMoneyLabel->adjustSize();
}
}