From ea6f492198a03cffc3be47df000fa16dfc3b262f Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 24 Jul 2009 14:19:21 -0600 Subject: Remove an ifdef in StatusWindow and update MP more Also make MiniStatus only update the bars when needed (called by StatusWindow). --- src/gui/statuswindow.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/gui/statuswindow.cpp') diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 1b764615..5d4ad8c4 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -28,6 +28,8 @@ #include "gui/widgets/scrollarea.h" #include "gui/widgets/vertcontainer.h" #include "gui/widgets/windowcontainer.h" + +#include "gui/ministatus.h" #include "gui/setup.h" #include "localplayer.h" @@ -181,18 +183,24 @@ std::string StatusWindow::update(int id) { updateHPBar(mHpBar, true); + miniStatusWindow->update(HP); + return _("HP"); } else if (id == MP) { updateMPBar(mMpBar, true); + miniStatusWindow->update(MP); + return _("MP"); } else if (id == EXP) { updateXPBar(mXpBar, false); + miniStatusWindow->update(EXP); + return _("Exp"); } else if (id == MONEY) @@ -370,12 +378,10 @@ void StatusWindow::updateMPBar(ProgressBar *bar, bool showMax) else bar->setText(toString(player_node->getMP())); -#ifdef EATHENA_SUPPORT - if (player_node->getAttributeEffective(MATK) <= 0) - bar->setColor(100, 100, 100); // grey, to indicate that we lack magic - else -#endif + if (Net::getPlayerHandler()->canUseMagic()) bar->setColor(26, 102, 230); // blue, to indicate that we have magic + else + bar->setColor(100, 100, 100); // grey, to indicate that we lack magic bar->setProgress((float) player_node->getMP() / (float) player_node->getMaxMP()); -- cgit v1.2.3-60-g2f50