summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-21 00:32:40 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-21 00:32:40 +0300
commit593dcda16950ae79ebe97de6a3b49cf7bb5e95f7 (patch)
tree405e2692f991149f087f4fb25dc1ae167b936c6d /src
parent4a93a8cee81a1e49e17fb51f4e0c9ec51899ddea (diff)
downloadmanaplus-593dcda16950ae79ebe97de6a3b49cf7bb5e95f7.tar.gz
manaplus-593dcda16950ae79ebe97de6a3b49cf7bb5e95f7.tar.bz2
manaplus-593dcda16950ae79ebe97de6a3b49cf7bb5e95f7.tar.xz
manaplus-593dcda16950ae79ebe97de6a3b49cf7bb5e95f7.zip
Add ability to change gui opacity from theme file.
Set opacity for jewelry theme to 1.
Diffstat (limited to 'src')
-rw-r--r--src/gui/setup_theme.cpp2
-rw-r--r--src/gui/theme.cpp6
-rw-r--r--src/gui/theme.h4
3 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/setup_theme.cpp b/src/gui/setup_theme.cpp
index 8002ceff8..f46202eb7 100644
--- a/src/gui/setup_theme.cpp
+++ b/src/gui/setup_theme.cpp
@@ -500,6 +500,8 @@ void Setup_Theme::apply()
if (size >= 0)
mNpcFontSizeDropDown->setSelected(size);
}
+ if (mInfo->guiAlpha > 0.01f)
+ config.setValue("guialpha", mInfo->guiAlpha);
}
config.setValue("theme", mTheme);
config.setValue("lang", mLang);
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 999b2ec2b..8f10a9372 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -1226,6 +1226,10 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name,
info->name = atoi(reinterpret_cast<const char*>(\
xmlNodeGetContent(infoNode)))
+#define readFloatValue(name) \
+ info->name = atof(reinterpret_cast<const char*>(\
+ xmlNodeGetContent(infoNode)))
+
ThemeInfo *Theme::loadInfo(const std::string &themeName)
{
std::string path;
@@ -1271,6 +1275,8 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName)
readIntValue(fontSize);
else if (xmlNameEqual(infoNode, "npcfontSize"))
readIntValue(npcfontSize);
+ else if (xmlNameEqual(infoNode, "guialpha"))
+ readFloatValue(guiAlpha);
else if (xmlNameEqual(infoNode, fontSize2.c_str()))
readIntValue(fontSize);
else if (xmlNameEqual(infoNode, npcfontSize2.c_str()))
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 38e3b7024..3a56cfcfb 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -53,7 +53,8 @@ struct ThemeInfo final
secureFont(),
japanFont(),
fontSize(0),
- npcfontSize(0)
+ npcfontSize(0),
+ guiAlpha(0.0f)
{
}
std::string name;
@@ -66,6 +67,7 @@ struct ThemeInfo final
std::string japanFont;
int fontSize;
int npcfontSize;
+ float guiAlpha;
};
class Skin final