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/emoteshortcutcontainer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/gui/emoteshortcutcontainer.cpp') diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp index f5ee9843..e35d037f 100644 --- a/src/gui/emoteshortcutcontainer.cpp +++ b/src/gui/emoteshortcutcontainer.cpp @@ -22,6 +22,7 @@ #include "emoteshortcutcontainer.h" #include "../animatedsprite.h" +#include "../configuration.h" #include "../emoteshortcut.h" #include "../graphics.h" #include "../inventory.h" @@ -42,11 +43,10 @@ static const int MAX_ITEMS = 12; EmoteShortcutContainer::EmoteShortcutContainer(): + ShortcutContainer(), mEmoteClicked(false), mEmoteMoved(0) { - mGridWidth = 1, - mGridHeight = 1, addMouseListener(this); addWidgetListener(this); @@ -54,6 +54,8 @@ EmoteShortcutContainer::EmoteShortcutContainer(): mBackgroundImg = resman->getImage("graphics/gui/item_shortcut_bgr.png"); + mBackgroundImg->setAlpha(config.getValue("guialpha", 0.8)); + // Setup emote sprites for (int i = 0; i <= EmoteDB::getLast(); i++) { @@ -96,6 +98,7 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) } } + if (mEmoteMoved) { // Draw the emote image being dragged by the cursor. @@ -108,6 +111,12 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) sprite->draw(g, tPosX, tPosY); } } + + if (config.getValue("guialpha", 0.8) != mAlpha) + { + mAlpha = config.getValue("guialpha", 0.8); + mBackgroundImg->setAlpha(mAlpha); + } } void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) -- cgit v1.2.3-70-g09d2