diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/ministatus.cpp | 12 | ||||
-rw-r--r-- | src/gui/statuswindow.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 5 |
3 files changed, 20 insertions, 9 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 8aaeb580..6d541474 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -36,10 +36,16 @@ MiniStatusWindow::MiniStatusWindow(): Popup("MiniStatus") { - mHpBar = new ProgressBar(0.0f, 100, 20, gcn::Color(0, 171, 34)); + mHpBar = new ProgressBar((float) player_node->getHp() + / (float) player_node->getMaxHp(), + 100, 20, gcn::Color(0, 171, 34)); #ifdef EATHENA_SUPPORT - mMpBar = new ProgressBar(0.0f, 100, 20, gcn::Color(26, 102, 230)); - mXpBar = new ProgressBar(0.0f, 100, 20, gcn::Color(143, 192, 211)); + mMpBar = new ProgressBar((float) player_node->getMaxMP() + / (float) player_node->getMaxMP(), + 100, 20, gcn::Color(26, 102, 230)); + mXpBar = new ProgressBar((float) player_node->getExp() + / player_node->getExpNeeded(), + 100, 20, gcn::Color(143, 192, 211)); #endif mHpBar->setPosition(0, 3); diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 9e5bb3cd..76828e22 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -97,13 +97,19 @@ StatusWindow::StatusWindow(): mMoneyLabel = new Label("Money:"); mHpLabel = new Label("HP:"); - mHpBar = new ProgressBar(0.0f, 80, 15, gcn::Color(0, 171, 34)); + mHpBar = new ProgressBar((float) player_node->getHp() + / (float) player_node->getMaxHp(), + 80, 15, gcn::Color(0, 171, 34)); mXpLabel = new Label(_("Exp:")); - mXpBar = new ProgressBar(0.0f, 80, 15, gcn::Color(143, 192, 211)); + mXpBar = new ProgressBar((float) player_node->getExp() + / player_node->getExpNeeded(), + 80, 15, gcn::Color(143, 192, 211)); mMpLabel = new Label(_("MP:")); - mMpBar = new ProgressBar(0.0f, 80, 15, gcn::Color(26, 102, 230)); + mMpBar = new ProgressBar((float) player_node->getMaxMP() + / (float) player_node->getMaxMP(), + 80, 15, gcn::Color(26, 102, 230)); place(0, 0, mLvlLabel, 3); // 5, 0 Job Level diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 134d071f..359cbf49 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -43,14 +43,13 @@ ProgressBar::ProgressBar(float progress, int width, int height, const gcn::Color &color): gcn::Widget(), - mProgress(0.0f), - mProgressToGo(0.0f), + mProgress(progress), + mProgressToGo(progress), mSmoothProgress(true), mColor(color), mColorToGo(color), mSmoothColorChange(true) { - setProgress(progress); setSize(width, height); if (mInstances == 0) |