From a4007a7f8f253e90bb189cfb22b3e0c798440bdc Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 8 Feb 2010 15:39:02 -0700 Subject: Fix some bugs in party handling and add HP to AvatarListBox --- src/gui/widgets/avatarlistbox.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui') 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) { -- cgit v1.2.3-70-g09d2