summaryrefslogtreecommitdiff
path: root/src/gui/statuswindow.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-24 14:19:21 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-24 14:19:21 -0600
commitea6f492198a03cffc3be47df000fa16dfc3b262f (patch)
tree01ba3216ecbfa0bf1520211a940d689a8874baba /src/gui/statuswindow.cpp
parent6f9ca0023ce77eb74d199a3c2e04e7d2b9d07494 (diff)
downloadmana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.gz
mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.bz2
mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.tar.xz
mana-ea6f492198a03cffc3be47df000fa16dfc3b262f.zip
Remove an ifdef in StatusWindow and update MP more
Also make MiniStatus only update the bars when needed (called by StatusWindow).
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r--src/gui/statuswindow.cpp16
1 files changed, 11 insertions, 5 deletions
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());