From d57be9d49c55bc0b85eb8f539ff2029518cfafc0 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 30 Jan 2009 10:56:54 -0700 Subject: 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 --- src/gui/progressbar.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gui/progressbar.cpp') 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)-> drawImageRect(0, 0, getWidth(), getHeight(), mBorder); -- cgit v1.2.3-70-g09d2