summaryrefslogtreecommitdiff
path: root/src/gui/windows/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-12 18:52:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-12 18:52:13 +0300
commit388f348acf3aeb954dae3160efeb6a8cd5fe6e4a (patch)
treec4c5b9af46c5921682f7aa45b75350be87955a19 /src/gui/windows/statuswindow.cpp
parente082aa3439e3ffb4b69c491be1dc881e9c14abce (diff)
downloadplus-388f348acf3aeb954dae3160efeb6a8cd5fe6e4a.tar.gz
plus-388f348acf3aeb954dae3160efeb6a8cd5fe6e4a.tar.bz2
plus-388f348acf3aeb954dae3160efeb6a8cd5fe6e4a.tar.xz
plus-388f348acf3aeb954dae3160efeb6a8cd5fe6e4a.zip
Remove manaserv related flag for use mana bar.
Diffstat (limited to 'src/gui/windows/statuswindow.cpp')
-rw-r--r--src/gui/windows/statuswindow.cpp63
1 files changed, 25 insertions, 38 deletions
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 53240a0c7..7a2a2c206 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -128,39 +128,30 @@ StatusWindow::StatusWindow() :
mXpBar->setColor(getThemeColor(ThemeColorId::XP_BAR),
getThemeColor(ThemeColorId::XP_BAR_OUTLINE));
- const bool magicBar = gameHandler->canUseMagicBar();
const bool job = serverConfig.getValueBool("showJob", true);
- if (magicBar)
+ max = PlayerInfo::getAttribute(Attributes::MAX_MP);
+ // TRANSLATORS: status window label
+ mMpLabel = new Label(this, _("MP:"));
+ const bool useMagic = playerHandler->canUseMagic();
+ mMpBar = new ProgressBar(this,
+ max ? static_cast<float>(PlayerInfo::getAttribute(
+ Attributes::MAX_MP)) / static_cast<float>(max)
+ : static_cast<float>(0),
+ 80,
+ 0,
+ useMagic ? ProgressColorId::PROG_MP : ProgressColorId::PROG_NO_MP,
+ useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml",
+ useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml");
+ if (useMagic)
{
- max = PlayerInfo::getAttribute(Attributes::MAX_MP);
- // TRANSLATORS: status window label
- mMpLabel = new Label(this, _("MP:"));
- const bool useMagic = playerHandler->canUseMagic();
- mMpBar = new ProgressBar(this,
- max ? static_cast<float>(PlayerInfo::getAttribute(
- Attributes::MAX_MP)) / static_cast<float>(max)
- : static_cast<float>(0),
- 80,
- 0,
- useMagic ? ProgressColorId::PROG_MP : ProgressColorId::PROG_NO_MP,
- useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml",
- useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml");
- if (useMagic)
- {
- mMpBar->setColor(getThemeColor(ThemeColorId::MP_BAR),
- getThemeColor(ThemeColorId::MP_BAR_OUTLINE));
- }
- else
- {
- mMpBar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR),
- getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE));
- }
+ mMpBar->setColor(getThemeColor(ThemeColorId::MP_BAR),
+ getThemeColor(ThemeColorId::MP_BAR_OUTLINE));
}
else
{
- mMpLabel = nullptr;
- mMpBar = nullptr;
+ mMpBar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR),
+ getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE));
}
place(0, 0, mLvlLabel, 3);
@@ -168,15 +159,12 @@ StatusWindow::StatusWindow() :
place(1, 1, mHpBar, 4);
place(5, 1, mXpLabel).setPadding(3);
place(6, 1, mXpBar, 5);
- if (magicBar)
- {
- place(0, 2, mMpLabel).setPadding(3);
- // 5, 2 and 6, 2 Job Progress Bar
- if (job)
- place(1, 2, mMpBar, 4);
- else
- place(1, 2, mMpBar, 10);
- }
+ place(0, 2, mMpLabel).setPadding(3);
+ // 5, 2 and 6, 2 Job Progress Bar
+ if (job)
+ place(1, 2, mMpBar, 4);
+ else
+ place(1, 2, mMpBar, 10);
if (job)
{
@@ -224,8 +212,7 @@ StatusWindow::StatusWindow() :
// Update bars
updateHPBar(mHpBar, true);
- if (magicBar)
- updateMPBar(mMpBar, true);
+ updateMPBar(mMpBar, true);
updateXPBar(mXpBar, false);
// TRANSLATORS: status window label