diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-16 15:50:00 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-16 15:50:00 +0000 |
commit | 32badd4b6f843cb74fdc3238fe92119518c8c0ab (patch) | |
tree | ade2ace7f5ef62ae9fd14c6409d9c2df43a2348b /src/gui/ministatus.cpp | |
parent | 65ccfccfc1e35a2e65638aea61c46e4e51bd874e (diff) | |
download | mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.gz mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.bz2 mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.xz mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.zip |
A bunch of cosmetic changes.
Diffstat (limited to 'src/gui/ministatus.cpp')
-rw-r--r-- | src/gui/ministatus.cpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index e4cfc6a6..fc2f451b 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -23,7 +23,6 @@ #include "ministatus.h" -#include <guichan/imagefont.hpp> #include <guichan/widgets/label.hpp> #include <sstream> @@ -48,12 +47,18 @@ MiniStatusWindow::MiniStatusWindow(): mHpBar->setPosition(0, 3); mMpBar->setPosition(mHpBar->getWidth() + 3, 3); + mHpLabel->setDimension(mHpBar->getDimension()); + mMpLabel->setDimension(mMpBar->getDimension()); + mHpLabel->setForegroundColor(gcn::Color(255, 255, 255)); mMpLabel->setForegroundColor(gcn::Color(255, 255, 255)); mHpLabel->setFont(speechFont); mMpLabel->setFont(speechFont); + mHpLabel->setAlignment(gcn::Graphics::CENTER); + mMpLabel->setAlignment(gcn::Graphics::CENTER); + add(mHpBar); add(mMpBar); add(mHpLabel); @@ -70,16 +75,13 @@ void MiniStatusWindow::update() { mHpBar->setColor(223, 32, 32); // Red } + else if (player_node->mHp < int((player_node->mMaxHp / 3) * 2)) + { + mHpBar->setColor(230, 171, 34); // Orange + } else { - if (player_node->mHp < int((player_node->mMaxHp / 3) * 2)) - { - mHpBar->setColor(230, 171, 34); // Orange - } - else - { - mHpBar->setColor(0, 171, 34); // Green - } + mHpBar->setColor(0, 171, 34); // Green } mHpBar->setProgress((float)player_node->mHp / (float)player_node->mMaxHp); @@ -89,21 +91,9 @@ void MiniStatusWindow::update() std::stringstream updatedText; updatedText << player_node->mHp; mHpLabel->setCaption(updatedText.str()); - mHpLabel->adjustSize(); updatedText.str(""); updatedText << player_node->mMp; mMpLabel->setCaption(updatedText.str()); - mMpLabel->adjustSize(); - mHpLabel->setPosition( - mHpBar->getX() + - int((mHpBar->getWidth() / 2) - (mHpLabel->getWidth() / 2)), - mHpBar->getY() + - int((mHpBar->getHeight() / 2) - (mHpLabel->getHeight() / 2))); - mMpLabel->setPosition( - mMpBar->getX() + - int((mMpBar->getWidth() / 2) - (mMpLabel->getWidth() / 2)), - mMpBar->getY() + - int((mMpBar->getHeight() / 2) - (mMpLabel->getHeight() / 2))); } void MiniStatusWindow::draw(gcn::Graphics *graphics) |