summaryrefslogtreecommitdiff
path: root/src/gui/windows/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-09 13:57:30 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-09 13:57:30 +0300
commit28999e7571b66733dcf0ddbc7e376c2c3fc1bfae (patch)
treed507a9857af937ab93f1a6414d3311ee6b0aef43 /src/gui/windows/statuswindow.cpp
parent7cccaaa192c2ed274b3aa9d26788479f6fbed611 (diff)
downloadmanaverse-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.gz
manaverse-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.bz2
manaverse-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.xz
manaverse-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.zip
Add text colors for mp bar.
New theme colors: MP_BAR, MP_BAR_OUTLINE, NO_MP_BAR, NO_MP_BAR_OUTLINE
Diffstat (limited to 'src/gui/windows/statuswindow.cpp')
-rw-r--r--src/gui/windows/statuswindow.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 19d862443..bf93efbee 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -209,11 +209,21 @@ StatusWindow::StatusWindow() :
max = PlayerInfo::getAttribute(PlayerInfo::MAX_MP);
// TRANSLATORS: status window label
mMpLabel = new Label(this, _("MP:"));
+ const bool useMagic = Net::getPlayerHandler()->canUseMagic();
mMpBar = new ProgressBar(this, max ? static_cast<float>(
PlayerInfo::getAttribute(PlayerInfo::MAX_MP))
/ static_cast<float>(max) : static_cast<float>(0),
- 80, 0, Net::getPlayerHandler()->canUseMagic() ?
- Theme::PROG_MP : Theme::PROG_NO_MP);
+ 80, 0, useMagic ? Theme::PROG_MP : Theme::PROG_NO_MP);
+ if (useMagic)
+ {
+ mMpBar->setColor(Theme::getThemeColor(Theme::MP_BAR),
+ Theme::getThemeColor(Theme::MP_BAR_OUTLINE));
+ }
+ else
+ {
+ mMpBar->setColor(Theme::getThemeColor(Theme::NO_MP_BAR),
+ Theme::getThemeColor(Theme::NO_MP_BAR_OUTLINE));
+ }
}
else
{
@@ -523,9 +533,17 @@ void StatusWindow::updateMPBar(ProgressBar *const bar, const bool showMax)
prog = static_cast<float>(mp) / static_cast<float>(maxMp);
if (Net::getPlayerHandler()->canUseMagic())
+ {
+ bar->setColor(Theme::getThemeColor(Theme::MP_BAR),
+ Theme::getThemeColor(Theme::MP_BAR_OUTLINE));
bar->setProgressPalette(Theme::PROG_MP);
+ }
else
+ {
+ bar->setColor(Theme::getThemeColor(Theme::NO_MP_BAR),
+ Theme::getThemeColor(Theme::NO_MP_BAR_OUTLINE));
bar->setProgressPalette(Theme::PROG_NO_MP);
+ }
bar->setProgress(prog);
}