summaryrefslogtreecommitdiff
path: root/src/gui/widgets/avatarlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-25 23:56:55 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-25 23:56:55 +0300
commit7cf334f49fe9157aabeef8eb1e69e115749d1b8f (patch)
tree7b5bb97a0b3079bf7e1aa6dcf277f8989952f98d /src/gui/widgets/avatarlistbox.cpp
parente0ad1f9076f322f18b54c4f1e0894a9cdd52937c (diff)
downloadmanaplus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.gz
manaplus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.bz2
manaplus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.xz
manaplus-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.zip
If player poisoned, hightlight his life bar in social window with special color.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 5ce74bfca..9411c2249 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -154,14 +154,16 @@ void AvatarListBox::draw(Graphics *graphics)
text = strprintf("%s %d/%d", a->getComplexName().c_str(),
a->getHp(), a->getMaxHp());
}
- if (parent && a->getMaxHp())
+ const bool isPoison = a->getPoison();
+ if (a->getMaxHp() && (isPoison || parent))
{
+ const int themeColor = (isPoison
+ ? Theme::PROG_HP_POISON : Theme::PROG_HP);
Color color = Theme::getProgressColor(
- Theme::PROG_HP, static_cast<float>(a->getHp())
- / static_cast<float>(a->getMaxHp()));
+ themeColor, static_cast<float>(a->getHp())
+ / static_cast<float>(a->getMaxHp()));
color.a = 80;
graphics->setColor(color);
-
graphics->fillRectangle(Rect(mPadding, y + mPadding,
parent->getWidth() * a->getHp() / a->getMaxHp()
- 2 * mPadding, fontHeight));
@@ -182,8 +184,9 @@ void AvatarListBox::draw(Graphics *graphics)
if (parent)
{
- Color color = Theme::getProgressColor(Theme::PROG_HP, 1);
-
+ const int themeColor = (a->getPoison()
+ ? Theme::PROG_HP_POISON : Theme::PROG_HP);
+ Color color = Theme::getProgressColor(themeColor, 1);
color.a = 80;
graphics->setColor(color);
graphics->fillRectangle(Rect(mPadding, y + mPadding,