diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-30 10:56:54 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-30 10:56:54 -0700 |
commit | d57be9d49c55bc0b85eb8f539ff2029518cfafc0 (patch) | |
tree | df3726aab3d3a4227330496e3b54803a713b1e7d /src/gui/progressbar.cpp | |
parent | cc37b4a9153379d5c5529ba85305d36efba2cd85 (diff) | |
download | mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.gz mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.bz2 mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.xz mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.zip |
Exposed most gui elements to take alpha values. There are still a few
spots that could also be fixed up as well, but require other methods to
fix them (the filled color rectangles on the progress bars, as well as
the text on them as well, as an example).
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/progressbar.cpp')
-rw-r--r-- | src/gui/progressbar.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index ecc0017d..d9db0c3c 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -22,6 +22,7 @@ #include "gui.h" #include "progressbar.h" +#include "../configuration.h" #include "../graphics.h" #include "../resources/image.h" @@ -31,6 +32,7 @@ ImageRect ProgressBar::mBorder; int ProgressBar::mInstances = 0; +float ProgressBar::mAlpha = config.getValue("guialpha", 0.8); ProgressBar::ProgressBar(float progress, unsigned int width, unsigned int height, @@ -56,6 +58,12 @@ ProgressBar::ProgressBar(float progress, mBorder.grid[6] = dBorders->getSubImage(0, 15, 4, 4); mBorder.grid[7] = dBorders->getSubImage(4, 15, 3, 4); mBorder.grid[8] = dBorders->getSubImage(7, 15, 4, 4); + + for (int i = 0; i < 9; i++) + { + mBorder.grid[i]->setAlpha(mAlpha); + } + dBorders->decRef(); } @@ -93,6 +101,15 @@ void ProgressBar::logic() void ProgressBar::draw(gcn::Graphics *graphics) { + if (config.getValue("guialpha", 0.8) != mAlpha) + { + mAlpha = config.getValue("guialpha", 0.8); + for (int i = 0; i < 9; i++) + { + mBorder.grid[i]->setAlpha(mAlpha); + } + } + static_cast<Graphics*>(graphics)-> drawImageRect(0, 0, getWidth(), getHeight(), mBorder); |