diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-07-14 19:14:30 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-07-14 19:14:30 +0000 |
commit | c44f66d94c9a26e2a13e59334abe18c63f925b74 (patch) | |
tree | 0e75f5885fbd3ce2b258229dcec262c22bb03a2b | |
parent | a960e4a0abf38104f91c6a13d3d91efb9407b4c5 (diff) | |
download | mana-c44f66d94c9a26e2a13e59334abe18c63f925b74.tar.gz mana-c44f66d94c9a26e2a13e59334abe18c63f925b74.tar.bz2 mana-c44f66d94c9a26e2a13e59334abe18c63f925b74.tar.xz mana-c44f66d94c9a26e2a13e59334abe18c63f925b74.zip |
Smooth fading of the XP Bar Coloration.
-rw-r--r-- | src/gui/status.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/status.cpp b/src/gui/status.cpp index a8f13660..604f6abf 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -151,6 +151,7 @@ void StatusWindow::update() jobExpLabel->setCaption(tempstr); jobExpLabel->adjustSize(); + // HP Bar coloration if (char_info->hp < int(char_info->max_hp / 3)) { healthBar->setColor(255, 0, 0); // Red @@ -167,6 +168,10 @@ void StatusWindow::update() } } + // XP Bar dark blue to light blue Smooth fading + unsigned char redXP = unsigned(char(((float)char_info->xp / (float)char_info->xpForNextLevel) * 12)); + unsigned char greenXP = unsigned(char(((float)char_info->xp / (float)char_info->xpForNextLevel) * 94)); + xpBar->setColor(redXP, 100 + greenXP, 255); healthBar->setProgress((float)char_info->hp / (float)char_info->max_hp); |