summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/graphics/gui/colors.xml4
-rw-r--r--data/themes/blacknblack/colors.xml4
-rw-r--r--data/themes/blackwood/colors.xml4
-rw-r--r--data/themes/enchilado/colors.xml4
-rw-r--r--data/themes/jewelry/colors.xml12
-rw-r--r--data/themes/mana/colors.xml4
-rw-r--r--data/themes/pink/colors.xml4
-rw-r--r--data/themes/unity/colors.xml4
-rw-r--r--data/themes/wood/colors.xml4
-rw-r--r--src/gui/theme.cpp4
-rw-r--r--src/gui/theme.h4
-rw-r--r--src/gui/windows/ministatuswindow.cpp3
-rw-r--r--src/gui/windows/statuswindow.cpp22
13 files changed, 74 insertions, 3 deletions
diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml
index 2e8cd6d5c..cf5a37fbf 100644
--- a/data/graphics/gui/colors.xml
+++ b/data/graphics/gui/colors.xml
@@ -103,6 +103,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
</palette>
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
diff --git a/data/themes/blacknblack/colors.xml b/data/themes/blacknblack/colors.xml
index 1dd0d8176..18879b319 100644
--- a/data/themes/blacknblack/colors.xml
+++ b/data/themes/blacknblack/colors.xml
@@ -93,6 +93,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#555555" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#555555" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#555555" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#555555" />
<color id="BLACK" color="#ffffff" />
<color id="RED" color="#ffffff" />
diff --git a/data/themes/blackwood/colors.xml b/data/themes/blackwood/colors.xml
index f744eef7d..9d066891d 100644
--- a/data/themes/blackwood/colors.xml
+++ b/data/themes/blackwood/colors.xml
@@ -92,6 +92,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#7a7972" />
<color id="RED" color="#ff0000" />
diff --git a/data/themes/enchilado/colors.xml b/data/themes/enchilado/colors.xml
index a20f8c240..821ca0f23 100644
--- a/data/themes/enchilado/colors.xml
+++ b/data/themes/enchilado/colors.xml
@@ -93,6 +93,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#000000" />
<color id="RED" color="#ff0000" />
diff --git a/data/themes/jewelry/colors.xml b/data/themes/jewelry/colors.xml
index 0258326db..587088a29 100644
--- a/data/themes/jewelry/colors.xml
+++ b/data/themes/jewelry/colors.xml
@@ -90,6 +90,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
</palette>
<palette id="1">
@@ -257,6 +261,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
</palette>
<palette id="2">
@@ -348,6 +356,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
</palette>
<progressbar id="HP" color="#b80000" />
diff --git a/data/themes/mana/colors.xml b/data/themes/mana/colors.xml
index 6dbbb95f8..b3140fdae 100644
--- a/data/themes/mana/colors.xml
+++ b/data/themes/mana/colors.xml
@@ -93,6 +93,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#000000" />
<color id="RED" color="#ff0000" />
diff --git a/data/themes/pink/colors.xml b/data/themes/pink/colors.xml
index 851890e30..af840806a 100644
--- a/data/themes/pink/colors.xml
+++ b/data/themes/pink/colors.xml
@@ -93,6 +93,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#000000" />
<color id="RED" color="#ff0000" />
diff --git a/data/themes/unity/colors.xml b/data/themes/unity/colors.xml
index 8346794fc..8086ea7d5 100644
--- a/data/themes/unity/colors.xml
+++ b/data/themes/unity/colors.xml
@@ -92,6 +92,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#0E0E0E" />
<color id="RED" color="#FFA8A8" />
diff --git a/data/themes/wood/colors.xml b/data/themes/wood/colors.xml
index e7e02e93d..bba2e9cd6 100644
--- a/data/themes/wood/colors.xml
+++ b/data/themes/wood/colors.xml
@@ -93,6 +93,10 @@
<color id="SLOTS_BAR_OUTLINE" color="#000000" />
<color id="HP_BAR" color="#ffffff" />
<color id="HP_BAR_OUTLINE" color="#000000" />
+ <color id="MP_BAR" color="#ffffff" />
+ <color id="MP_BAR_OUTLINE" color="#000000" />
+ <color id="NO_MP_BAR" color="#ffffff" />
+ <color id="NO_MP_BAR_OUTLINE" color="#000000" />
<color id="BLACK" color="#000000" />
<color id="RED" color="#ff0000" />
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 274be10df..5935442c0 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -955,6 +955,10 @@ static int readColorType(const std::string &type)
"SLOTS_BAR_OUTLINE",
"HP_BAR",
"HP_BAR_OUTLINE"
+ "MP_BAR",
+ "MP_BAR_OUTLINE"
+ "NO_MP_BAR",
+ "NO_MP_BAR_OUTLINE"
};
if (type.empty())
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 58a194d63..bd3db6f66 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -398,6 +398,10 @@ class Theme final : public Palette, public ConfigListener
SLOTS_BAR_OUTLINE,
HP_BAR,
HP_BAR_OUTLINE,
+ MP_BAR,
+ MP_BAR_OUTLINE,
+ NO_MP_BAR,
+ NO_MP_BAR_OUTLINE,
THEME_COLORS_END
};
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 0141354ee..8186f1e04 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -65,7 +65,8 @@ MiniStatusWindow::MiniStatusWindow() :
mHpBar(createBar(0, 100, 0, Theme::HP_BAR, Theme::PROG_HP,
"hp bar", _("health bar"))),
mMpBar(Net::getGameHandler()->canUseMagicBar()
- ? createBar(0, 100, 0, Theme::PROGRESS_BAR,
+ ? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic()
+ ? Theme::MP_BAR : Theme::NO_MP_BAR,
Net::getPlayerHandler()->canUseMagic()
// TRANSLATORS: status bar name
? Theme::PROG_MP : Theme::PROG_NO_MP, "mp bar", _("mana bar"))
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);
}