summaryrefslogtreecommitdiff
path: root/src/gui/popup.cpp
diff options
context:
space:
mode:
authorIra Rice <shogun@odin.(none)>2009-03-25 09:55:44 -0600
committerIra Rice <shogun@odin.(none)>2009-03-25 09:55:44 -0600
commitf6e7a477681109aea040456e3f4ebd0f65645ecc (patch)
tree258380203c03ede0fdaf8e2c0009a03bb1da8523 /src/gui/popup.cpp
parent46a368e2f6fd8fcc30949c6676045e2005bd5bfa (diff)
downloadmana-client-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.gz
mana-client-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.bz2
mana-client-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.xz
mana-client-f6e7a477681109aea040456e3f4ebd0f65645ecc.zip
Moved the responsibility for skin alpha adjustment to the Skin class.
This fixes a break that occured where skins wouldn't update in real time in the client, due to being passed a reference, rather than getting the skin itself. Signed-off-by: Ira Rice <shogun@odin.(none)>
Diffstat (limited to 'src/gui/popup.cpp')
-rw-r--r--src/gui/popup.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/gui/popup.cpp b/src/gui/popup.cpp
index 17d299a5..d44dbc93 100644
--- a/src/gui/popup.cpp
+++ b/src/gui/popup.cpp
@@ -20,8 +20,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <algorithm>
-#include <cassert>
#include <climits>
#include <guichan/exception.hpp>
@@ -38,17 +36,7 @@
#include "../resources/image.h"
-ConfigListener *Popup::popupConfigListener = 0;
int Popup::instances = 0;
-bool Popup::mAlphaChanged = false;
-
-class PopupConfigListener : public ConfigListener
-{
- void optionChanged(const std::string &)
- {
- Popup::mAlphaChanged = true;
- }
-};
Popup::Popup(const std::string& name, Window *parent,
const std::string& skin):
@@ -64,14 +52,6 @@ Popup::Popup(const std::string& name, Window *parent,
if (!windowContainer)
throw GCN_EXCEPTION("Popup::Popup(): no windowContainer set");
- if (instances == 0)
- {
- popupConfigListener = new PopupConfigListener();
- // Send GUI alpha changed for initialization
- popupConfigListener->optionChanged("guialpha");
- config.addListener("guialpha", popupConfigListener);
- }
-
setPadding(3);
instances++;
@@ -79,8 +59,6 @@ Popup::Popup(const std::string& name, Window *parent,
// Loads the skin
mSkin = skinLoader->load(skin);
- setGuiAlpha();
-
// Add this window to the window container
windowContainer->add(this);
@@ -102,13 +80,6 @@ Popup::~Popup()
instances--;
mSkin->instances--;
-
- if (instances == 0)
- {
- config.removeListener("guialpha", popupConfigListener);
- delete popupConfigListener;
- popupConfigListener = NULL;
- }
}
void Popup::setWindowContainer(WindowContainer *wc)
@@ -125,13 +96,6 @@ void Popup::draw(gcn::Graphics *graphics)
g->drawImageRect(0, 0, getWidth(), getHeight(), mSkin->getBorder());
- // Update Popup alpha values
- if (mAlphaChanged)
- {
- for_each(mSkin->getBorder().grid, mSkin->getBorder().grid + 9,
- std::bind2nd(std::mem_fun(&Image::setAlpha),
- config.getValue("guialpha", 0.8)));
- }
drawChildren(graphics);
}
@@ -195,15 +159,3 @@ void Popup::scheduleDelete()
windowContainer->scheduleDelete(this);
}
-void Popup::setGuiAlpha()
-{
- //logger->log("Popup::setGuiAlpha: Alpha Value %f", config.getValue("guialpha", 0.8));
- for (int i = 0; i < 9; i++)
- {
- //logger->log("Popup::setGuiAlpha: Border Image (%i)", i);
- mSkin->getBorder().grid[i]->setAlpha(config.getValue("guialpha", 0.8));
- }
-
- mAlphaChanged = false;
-}
-