diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-02-27 21:50:25 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-02-28 10:30:45 -0700 |
commit | 500ee24e22aae7b457118d152b4480e99969092e (patch) | |
tree | ea0e7e3869a80fbc86cffe97136b926cc7149bdd /src/gui/skin.h | |
parent | 64e742acdb9b0dd9c44bced91766f5ea1aa9de4c (diff) | |
download | mana-500ee24e22aae7b457118d152b4480e99969092e.tar.gz mana-500ee24e22aae7b457118d152b4480e99969092e.tar.bz2 mana-500ee24e22aae7b457118d152b4480e99969092e.tar.xz mana-500ee24e22aae7b457118d152b4480e99969092e.zip |
Make the gui more themeable and distribute two themes
The older gray theme and the new wood theme are available as themes.
The gray theme needs some new graphics for hilights.
Add a theme option for branding and add path/to/branding/data to the
PhysFS search path.
Reviewed-by: Thorbjørn Lindeijer
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui/skin.h')
-rw-r--r-- | src/gui/skin.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/skin.h b/src/gui/skin.h index 15d55972..091d3001 100644 --- a/src/gui/skin.h +++ b/src/gui/skin.h @@ -31,6 +31,7 @@ class ConfigListener; class Image; +class ImageSet; class Skin { @@ -101,11 +102,24 @@ class SkinLoader static SkinLoader *instance(); static void deleteInstance(); + static void prepareThemePath(); + static std::string getThemePath() { return mThemePath; } + + /** + * Returns the patch to the given gui resource relative to the theme + * or, if it isn't in the theme, relative to 'graphics/gui'. + */ + static std::string resolveThemePath(const std::string &path); + + static Image *getImageFromTheme(const std::string &path); + static ImageSet *getImageSetFromTheme(const std::string &path, + int w, int h); + /** * Loads a skin. */ Skin *load(const std::string &filename, - const std::string &defaultPath); + const std::string &defaultPath = getThemePath()); /** * Updates the alpha values of all of the skins. @@ -141,8 +155,11 @@ class SkinLoader */ ConfigListener *mSkinConfigListener; + static std::string mThemePath; static SkinLoader *mInstance; + static bool tryThemePath(std::string themePath); + /** * Tells if the current skins opacity * should not get less than the given value |