summaryrefslogtreecommitdiff
path: root/src/gui/skin.h
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/skin.h
parent46a368e2f6fd8fcc30949c6676045e2005bd5bfa (diff)
downloadmana-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.gz
mana-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.bz2
mana-f6e7a477681109aea040456e3f4ebd0f65645ecc.tar.xz
mana-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/skin.h')
-rw-r--r--src/gui/skin.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/skin.h b/src/gui/skin.h
index b8a1242e..c90952e3 100644
--- a/src/gui/skin.h
+++ b/src/gui/skin.h
@@ -27,6 +27,7 @@
#include "../graphics.h"
+class ConfigListener;
class Image;
class Skin
@@ -67,6 +68,11 @@ class Skin
*/
unsigned int getMinHeight();
+ /**
+ * Updates the alpha value of the skin
+ */
+ void updateAlpha();
+
int instances;
private:
@@ -84,6 +90,8 @@ typedef Skins::iterator SkinIterator;
class SkinLoader
{
public:
+ friend class SkinConfigListener;
+
SkinLoader();
~SkinLoader();
@@ -92,8 +100,18 @@ class SkinLoader
*/
Skin* load(const std::string &filename);
+ /**
+ * Updates the alpha values of all of the skins
+ */
+ void updateAlpha();
+
private:
Skins mSkins;
+
+ /**
+ * The config listener that listens to changes relevant to all skins.
+ */
+ static ConfigListener *skinConfigListener;
};
extern SkinLoader* skinLoader;