summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 9b8dc09b..e0730ced 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -23,6 +23,8 @@
#include "itemcontainer.h"
+#include <sstream>
+
#include <guichan/mouseinput.hpp>
#include "../graphics.h"
@@ -36,8 +38,6 @@
#include "../resources/iteminfo.h"
#include "../resources/resourcemanager.h"
-#include "../utils/tostring.h"
-
ItemContainer::ItemContainer(Inventory *inventory):
mInventory(inventory)
{
@@ -122,8 +122,16 @@ void ItemContainer::draw(gcn::Graphics* graphics)
}
// Draw item caption
- graphics->drawText(
- (item->isEquipped() ? "Eq." : toString(item->getQuantity())),
+ std::stringstream ss;
+
+ if (!item->isEquipped()) {
+ ss << item->getQuantity();
+ }
+ else {
+ ss << "Eq.";
+ }
+
+ graphics->drawText(ss.str(),
itemX + gridWidth / 2,
itemY + gridHeight - 11,
gcn::Graphics::CENTER);