summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-30 22:13:38 -0700
committerIra Rice <irarice@gmail.com>2009-01-30 22:13:38 -0700
commit0cf29b14232b08c7db9259bce26e96b59dac750c (patch)
tree0cbe0ca4d5f57e33232372edab24add3d3d14075
parent5b47d0933dcfb6e898ccfa56efe53eb53b7d30cb (diff)
downloadmana-0cf29b14232b08c7db9259bce26e96b59dac750c.tar.gz
mana-0cf29b14232b08c7db9259bce26e96b59dac750c.tar.bz2
mana-0cf29b14232b08c7db9259bce26e96b59dac750c.tar.xz
mana-0cf29b14232b08c7db9259bce26e96b59dac750c.zip
Made the shoplist box alpha blend.
Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r--src/gui/shoplistbox.cpp14
-rw-r--r--src/gui/shoplistbox.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index 765b9f08..9db33ac6 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -28,10 +28,13 @@
#include "shoplistbox.h"
+#include "../configuration.h"
#include "../graphics.h"
const int ITEM_ICON_SIZE = 32;
+float ShopListBox::mAlpha = config.getValue("guialpha", 0.8);
+
ShopListBox::ShopListBox(gcn::ListModel *listModel):
ListBox(listModel),
mPlayerMoney(0)
@@ -59,6 +62,11 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
if (!mListModel)
return;
+ if (config.getValue("guialpha", 0.8) != mAlpha)
+ mAlpha = config.getValue("guialpha", 0.8);
+
+ const int alpha = mAlpha * 255;
+
Graphics *graphics = static_cast<Graphics*>(gcnGraphics);
graphics->setFont(getFont());
@@ -68,16 +76,16 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
i < mListModel->getNumberOfElements();
++i, y += mRowHeight)
{
- gcn::Color backgroundColor = gcn::Color(0xffffff);
+ gcn::Color backgroundColor = gcn::Color(255, 255, 255, alpha);
if (i == mSelected)
{
- backgroundColor = gcn::Color(235, 200, 115);
+ backgroundColor = gcn::Color(235, 200, 115, alpha);
}
else if (mShopItems &&
mPlayerMoney < mShopItems->at(i)->getPrice() && mPriceCheck)
{
- backgroundColor = gcn::Color(0x919191);
+ backgroundColor = gcn::Color(145, 145, 145, alpha);
}
graphics->setColor(backgroundColor);
diff --git a/src/gui/shoplistbox.h b/src/gui/shoplistbox.h
index 733af4eb..12413585 100644
--- a/src/gui/shoplistbox.h
+++ b/src/gui/shoplistbox.h
@@ -86,6 +86,8 @@ class ShopListBox : public ListBox
unsigned int mRowHeight; /**< Row Height */
+ static float mAlpha;
+
bool mPriceCheck;
};