From 7cccaaa192c2ed274b3aa9d26788479f6fbed611 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Mon, 9 Dec 2013 13:35:16 +0300
Subject: Add text colors for hp bar.

New theme colors: HP_BAR, HP_BAR_OUTLINE
---
 src/gui/theme.cpp                    | 4 +++-
 src/gui/theme.h                      | 2 ++
 src/gui/windows/ministatuswindow.cpp | 2 +-
 src/gui/windows/statuswindow.cpp     | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

(limited to 'src/gui')

diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index cfbe26d03..274be10df 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -952,7 +952,9 @@ static int readColorType(const std::string &type)
         "STATUSBAR_OFF",
         "TABLE_BACKGROUND",
         "SLOTS_BAR",
-        "SLOTS_BAR_OUTLINE"
+        "SLOTS_BAR_OUTLINE",
+        "HP_BAR",
+        "HP_BAR_OUTLINE"
     };
 
     if (type.empty())
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 08d912430..58a194d63 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -396,6 +396,8 @@ class Theme final : public Palette, public ConfigListener
             TABLE_BACKGROUND,
             SLOTS_BAR,
             SLOTS_BAR_OUTLINE,
+            HP_BAR,
+            HP_BAR_OUTLINE,
             THEME_COLORS_END
         };
 
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index d2ff6b0bb..0141354ee 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -62,7 +62,7 @@ MiniStatusWindow::MiniStatusWindow() :
     mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2),
     mMaxX(0),
     // TRANSLATORS: status bar name
-    mHpBar(createBar(0, 100, 0, Theme::PROGRESS_BAR, Theme::PROG_HP,
+    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,
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 5d90ad078..19d862443 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -191,6 +191,8 @@ StatusWindow::StatusWindow() :
 
     mHpBar = new ProgressBar(this, static_cast<float>(PlayerInfo::getAttribute(
         PlayerInfo::HP)) / static_cast<float>(max), 80, 0, Theme::PROG_HP);
+    mHpBar->setColor(Theme::getThemeColor(Theme::HP_BAR),
+        Theme::getThemeColor(Theme::HP_BAR_OUTLINE));
 
     max = PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED);
     mXpBar = new ProgressBar(this, max ?
-- 
cgit v1.2.3-70-g09d2