diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-09 13:57:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-09 13:57:30 +0300 |
commit | 28999e7571b66733dcf0ddbc7e376c2c3fc1bfae (patch) | |
tree | d507a9857af937ab93f1a6414d3311ee6b0aef43 /src/gui/windows/statuswindow.cpp | |
parent | 7cccaaa192c2ed274b3aa9d26788479f6fbed611 (diff) | |
download | plus-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.gz plus-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.bz2 plus-28999e7571b66733dcf0ddbc7e376c2c3fc1bfae.tar.xz plus-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.cpp | 22 |
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); } |