From c44f66d94c9a26e2a13e59334abe18c63f925b74 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 14 Jul 2005 19:14:30 +0000 Subject: Smooth fading of the XP Bar Coloration. --- src/gui/status.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2