summaryrefslogtreecommitdiff
path: root/src/gui/status.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 22:56:29 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 22:56:29 +0000
commit3dc311a652d1fda1252903a974920395e56e5668 (patch)
tree7098d55015d28a4d973c5073d7c9e45ae03ec400 /src/gui/status.cpp
parent78771718bf7af14273d7bb0090dccff97b00b397 (diff)
downloadmana-3dc311a652d1fda1252903a974920395e56e5668.tar.gz
mana-3dc311a652d1fda1252903a974920395e56e5668.tar.bz2
mana-3dc311a652d1fda1252903a974920395e56e5668.tar.xz
mana-3dc311a652d1fda1252903a974920395e56e5668.zip
Merged with SDL_NET_TEST branch.
Diffstat (limited to 'src/gui/status.cpp')
-rw-r--r--src/gui/status.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index 7ba14fc7..7964768b 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -157,36 +157,36 @@ void StatusWindow::update()
char *tempstr = new char[64];
sprintf(tempstr, "%s Lvl: % 2i Job: % 2i GP: % 2i",
- char_info->name, char_info->lv, char_info->job_lv,
- char_info->gp);
+ player_info->name.c_str(), player_info->lv, player_info->job_lv,
+ player_info->gp);
setCaption(tempstr);
- sprintf(tempstr, "%d/%d", char_info->hp, char_info->max_hp);
+ sprintf(tempstr, "%d/%d", player_info->hp, player_info->max_hp);
hpValue->setCaption(tempstr);
hpValue->adjustSize();
- sprintf(tempstr, "%d/%d", char_info->sp, char_info->max_sp);
+ sprintf(tempstr, "%d/%d", player_info->sp, player_info->max_sp);
spValue->setCaption(tempstr);
spValue->adjustSize();
sprintf(tempstr, "Exp: %d/%d",
- (int)char_info->xp, (int)char_info->xpForNextLevel);
+ (int)player_info->xp, (int)player_info->xpForNextLevel);
expLabel->setCaption(tempstr);
expLabel->adjustSize();
sprintf(tempstr, "Job: %d/%d",
- (int)char_info->job_xp, (int)char_info->jobXpForNextLevel);
+ (int)player_info->job_xp, (int)player_info->jobXpForNextLevel);
jobExpLabel->setCaption(tempstr);
jobExpLabel->adjustSize();
// HP Bar coloration
- if (char_info->hp < int(char_info->max_hp / 3))
+ if (player_info->hp < int(player_info->max_hp / 3))
{
healthBar->setColor(223, 32, 32); // Red
}
else
{
- if (char_info->hp < int((char_info->max_hp / 3) * 2))
+ if (player_info->hp < int((player_info->max_hp / 3) * 2))
{
healthBar->setColor(230, 171, 34); // Orange
}
@@ -196,12 +196,14 @@ void StatusWindow::update()
}
}
- healthBar->setProgress((float)char_info->hp / (float)char_info->max_hp);
+ healthBar->setProgress((float)player_info->hp /
+ (float)player_info->max_hp);
- xpBar->setProgress(
- (float)char_info->xp / (float)char_info->xpForNextLevel);
- jobXpBar->setProgress(
- (float)char_info->job_xp / (float)char_info->jobXpForNextLevel);
+ xpBar->setProgress((float)player_info->xp /
+ (float)player_info->xpForNextLevel);
+
+ jobXpBar->setProgress((float)player_info->job_xp /
+ (float)player_info->jobXpForNextLevel);
delete[] tempstr;
}