diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-25 23:56:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-25 23:56:55 +0300 |
commit | 7cf334f49fe9157aabeef8eb1e69e115749d1b8f (patch) | |
tree | 7b5bb97a0b3079bf7e1aa6dcf277f8989952f98d /src/gui/widgets/avatarlistbox.cpp | |
parent | e0ad1f9076f322f18b54c4f1e0894a9cdd52937c (diff) | |
download | manaverse-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.gz manaverse-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.bz2 manaverse-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.xz manaverse-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.cpp | 15 |
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, |