summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp5
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/graphicsmanager.cpp7
-rw-r--r--src/gui/widgets/tabs/setup_visual.cpp4
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,