diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-25 18:03:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-25 18:03:20 +0300 |
commit | 314d315f8f1003073bbabec3188d7c1bdf395ea3 (patch) | |
tree | 5ace82272dec77c7cbe378aef06e38b09904ab19 | |
parent | a035d0001dc0cabeeda48b4cb4bcc53809c18ed8 (diff) | |
download | manaplus-314d315f8f1003073bbabec3188d7c1bdf395ea3.tar.gz manaplus-314d315f8f1003073bbabec3188d7c1bdf395ea3.tar.bz2 manaplus-314d315f8f1003073bbabec3188d7c1bdf395ea3.tar.xz manaplus-314d315f8f1003073bbabec3188d7c1bdf395ea3.zip |
Add separate flags for enable/disable gui opacity.
It need because not always possible set opacity to exact 1.0
-rw-r--r-- | src/client.cpp | 5 | ||||
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/graphicsmanager.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_visual.cpp | 4 |
4 files changed, 12 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp index 83ea42fa7..cf4d236fe 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1667,11 +1667,12 @@ void Client::optionChanged(const std::string &name) settings.limitFps = fpsLimit > 0; WindowManager::setFramerate(fpsLimit); } - else if (name == "guialpha") + else if (name == "guialpha" || name == "enableGuiOpacity") { const float alpha = config.getFloatValue("guialpha"); settings.guiAlpha = alpha; - ImageHelper::setEnableAlpha(alpha != 1.0F); + ImageHelper::setEnableAlpha(alpha != 1.0F && + config.getBoolValue("enableGuiOpacity")); } else if (name == "gamma" || name == "enableGamma") { diff --git a/src/defaults.cpp b/src/defaults.cpp index 4c243a19c..4e7c518a1 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -384,6 +384,7 @@ DefaultsData* getConfigDefaults() AddDEF("tradescreenshot", false); AddDEF("skillAutotarget", true); AddDEF("logPlayerActions", false); + AddDEF("enableGuiOpacity", true); return configData; } diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 3606c06e7..a429ac765 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -456,12 +456,13 @@ void GraphicsManager::initGraphics() OpenGLImageHelper::setBlur(config.getBoolValue("blur")); SurfaceImageHelper::SDLSetEnableAlphaCache( config.getBoolValue("alphaCache") && !openGLMode); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F - || openGLMode); + ImageHelper::setEnableAlpha((config.getFloatValue("guialpha") != 1.0F || + openGLMode) && config.getBoolValue("enableGuiOpacity")); #else SurfaceImageHelper::SDLSetEnableAlphaCache( config.getBoolValue("alphaCache")); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F && + config.getBoolValue("enableGuiOpacity")); #endif createRenderers(); detectPixelSize(); diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index 3d7a94219..5eb549f3a 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -143,6 +143,10 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) : new SetupItemSlider(_("Gui opacity"), "", "guialpha", this, "guialphaEvent", 0.1, 1.01, 0.1, 150, true, true); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Enable gui opacity"), + "", "enableGuiOpacity", this, "enableGuiOpacityEvent"); + mSpeachList->fillFromArray(&speachList[0], speachListSize); // TRANSLATORS: settings option new SetupItemDropDown(_("Overhead text"), "", "speech", this, |