summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-08 15:39:02 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-08 15:39:02 -0700
commita4007a7f8f253e90bb189cfb22b3e0c798440bdc (patch)
tree0b04750b4e108496f58490edd0e91c3d313c34a3 /src/gui
parent40e1928f3f20efe1be383c4c9a55dffc5506d56f (diff)
downloadmana-a4007a7f8f253e90bb189cfb22b3e0c798440bdc.tar.gz
mana-a4007a7f8f253e90bb189cfb22b3e0c798440bdc.tar.bz2
mana-a4007a7f8f253e90bb189cfb22b3e0c798440bdc.tar.xz
mana-a4007a7f8f253e90bb189cfb22b3e0c798440bdc.zip
Fix some bugs in party handling and add HP to AvatarListBox
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 566cd9de..69c3dfde 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -100,10 +100,22 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
if (a->getDisplayBold())
graphics->setFont(boldFont);
+ std::string text;
+
+ if (a->getMaxHp() > 0)
+ {
+ text = strprintf("%s %d/%d", a->getName().c_str(),
+ a->getHp(), a->getMaxHp());
+ }
+ else
+ {
+ text = a->getName();
+ }
+
// Draw Name
- graphics->drawText(a->getName(), 15, y);
+ graphics->drawText(text, 15, y);
- width = getFont()->getWidth(a->getName()) + 17; // Extra right padding
+ width = getFont()->getWidth(text) + 17; // Extra right padding
if (width > newWidth)
{