summaryrefslogtreecommitdiff
path: root/src/gui/skin.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-28 10:35:49 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-28 10:35:49 -0600
commit42a095de15649f0f00ef6c681268d6623205900c (patch)
tree1f7d509f088208fd5349e9a77d208637354636f3 /src/gui/skin.cpp
parentef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5 (diff)
downloadmana-42a095de15649f0f00ef6c681268d6623205900c.tar.gz
mana-42a095de15649f0f00ef6c681268d6623205900c.tar.bz2
mana-42a095de15649f0f00ef6c681268d6623205900c.tar.xz
mana-42a095de15649f0f00ef6c681268d6623205900c.zip
Add a sticky button to the Window class
The Minimap window uses this so you can froce it to always be open. The Minimap toggle button can be used to show or hide it temporarily, as warping will reset it's visibility based on the sticky state and weather the 'new' map has a minimap.
Diffstat (limited to 'src/gui/skin.cpp')
-rw-r--r--src/gui/skin.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp
index b16bdfe6..0130ad71 100644
--- a/src/gui/skin.cpp
+++ b/src/gui/skin.cpp
@@ -47,14 +47,16 @@ class SkinConfigListener : public ConfigListener
}
};
-Skin::Skin(ImageRect skin, Image *close,
+Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown,
const std::string &filePath,
const std::string &name):
instances(0),
mFilePath(filePath),
mName(name),
border(skin),
- closeImage(close)
+ closeImage(close),
+ stickyImageUp(stickyUp),
+ stickyImageDown(stickyDown)
{
}
@@ -219,7 +221,14 @@ Skin *SkinLoader::load(const std::string &filename,
// Hard-coded for now until we update the above code to look for window buttons.
Image *closeImage = resman->getImage("graphics/gui/close_button.png");
- Skin *skin = new Skin(border, closeImage, filename);
+ Image *sticky = resman->getImage("graphics/gui/sticky_button.png");
+ Image *stickyImageUp = sticky->getSubImage(0, 0, 15, 15);
+ Image *stickyImageDown = sticky->getSubImage(15, 0, 15, 15);
+
+ sticky->decRef();
+
+ Skin *skin = new Skin(border, closeImage, stickyImageUp, stickyImageDown,
+ filename);
mSkins[filename] = skin;