summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-19 20:29:23 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-20 13:55:42 +0300
commitc632452430cb3f886da38fa315cb27a3a3a10d2c (patch)
treebdaeac586877e77046ef38dd4ad7a97a6b4e7af0 /src/gui/palette.cpp
parentdbba47eabe087d503426b5c5862aaa9263861ea5 (diff)
downloadManaVerse-c632452430cb3f886da38fa315cb27a3a3a10d2c.tar.gz
ManaVerse-c632452430cb3f886da38fa315cb27a3a3a10d2c.tar.bz2
ManaVerse-c632452430cb3f886da38fa315cb27a3a3a10d2c.tar.xz
ManaVerse-c632452430cb3f886da38fa315cb27a3a3a10d2c.zip
Allow get colors from Widget2.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index 092a0daae..b73732e29 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -77,6 +77,19 @@ const gcn::Color& Palette::getCharColor(const signed char c, bool &valid)
return BLACK;
}
+int Palette::getIdByChar(const signed char c, bool &valid)
+{
+ const CharColors::const_iterator it = mCharColors.find(c);
+ if (it != mCharColors.end())
+ {
+ valid = true;
+ return (*it).second;
+ }
+
+ valid = false;
+ return 0;
+}
+
void Palette::advanceGradients()
{
for (Palettes::const_iterator it = mInstances.begin(),