diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
commit | 654d24e74c56d240b8d622840c135e22a029636d (patch) | |
tree | 5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/itemcontainer.cpp | |
parent | 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff) | |
download | mana-654d24e74c56d240b8d622840c135e22a029636d.tar.gz mana-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2 mana-654d24e74c56d240b8d622840c135e22a029636d.tar.xz mana-654d24e74c56d240b8d622840c135e22a029636d.zip |
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index e0730ced..9b8dc09b 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -23,8 +23,6 @@ #include "itemcontainer.h" -#include <sstream> - #include <guichan/mouseinput.hpp> #include "../graphics.h" @@ -38,6 +36,8 @@ #include "../resources/iteminfo.h" #include "../resources/resourcemanager.h" +#include "../utils/tostring.h" + ItemContainer::ItemContainer(Inventory *inventory): mInventory(inventory) { @@ -122,16 +122,8 @@ void ItemContainer::draw(gcn::Graphics* graphics) } // Draw item caption - std::stringstream ss; - - if (!item->isEquipped()) { - ss << item->getQuantity(); - } - else { - ss << "Eq."; - } - - graphics->drawText(ss.str(), + graphics->drawText( + (item->isEquipped() ? "Eq." : toString(item->getQuantity())), itemX + gridWidth / 2, itemY + gridHeight - 11, gcn::Graphics::CENTER); |