summaryrefslogtreecommitdiff
path: root/src/gui/itemshortcutcontainer.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-06 06:11:38 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-06 06:11:38 -0600
commit9e44d5af1d7576b99553305aa7cee53dd0f6ff45 (patch)
treec6c7607f8dcfe1ac59e1e508b6a661d0b3d1f10e /src/gui/itemshortcutcontainer.cpp
parentbcc4695387d21f9629ab6f013aadbfe0d238aa6d (diff)
downloadMana-9e44d5af1d7576b99553305aa7cee53dd0f6ff45.tar.gz
Mana-9e44d5af1d7576b99553305aa7cee53dd0f6ff45.tar.bz2
Mana-9e44d5af1d7576b99553305aa7cee53dd0f6ff45.tar.xz
Mana-9e44d5af1d7576b99553305aa7cee53dd0f6ff45.zip
Clean up and expand item equip handling in the GUI
Diffstat (limited to 'src/gui/itemshortcutcontainer.cpp')
-rw-r--r--src/gui/itemshortcutcontainer.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 62edd1af..f66aa84d 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -39,7 +39,6 @@
#include "resources/resourcemanager.h"
#include "utils/stringutils.h"
-#include "utils/strprintf.h"
ItemShortcutContainer::ItemShortcutContainer():
ShortcutContainer(),
@@ -107,11 +106,16 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics)
if (image)
{
- const std::string label = strprintf("%d%s",
- toString(item->getQuantity()).c_str(),
- item->isEquipped() ? "(Eq)" : "");
+ std::string caption;
+ if (item->getQuantity() > 1)
+ caption = toString(item->getQuantity());
+ else if (item->isEquipped())
+ caption = "(Eq)";
+
g->drawImage(image, itemX, itemY);
- g->drawText(label, itemX + mBoxWidth / 2,
+ if (item->isEquipped())
+ g->setColor(guiPalette->getColor(Palette::ITEM_EQUIPED));
+ g->drawText(caption, itemX + mBoxWidth / 2,
itemY + mBoxHeight - 14, gcn::Graphics::CENTER);
}
}