From 0b4ce8c4594c2e70c2e3157c58491757e13558be Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Aug 2011 03:37:30 +0300 Subject: Add option "show beings transparency". Disabled by default. --- src/map.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index f8c4e007e..abf6d73f0 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -622,7 +622,8 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): mDrawY(-1), mDrawScrollX(-1), mDrawScrollY(-1), - mRedrawMap(true) + mRedrawMap(true), + mBeingOpacity(false) { const int size = mWidth * mHeight; @@ -639,6 +640,7 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): config.addListener("OverlayDetail", this); config.addListener("guialpha", this); + config.addListener("beingopacity", this); #ifdef USE_OPENGL mOpenGL = config.getIntValue("opengl"); @@ -651,6 +653,7 @@ Map::~Map() { config.removeListener("OverlayDetail", this); config.removeListener("guialpha", this); + config.removeListener("beingopacity", this); // delete metadata, layers, tilesets and overlays delete[] mMetaTiles; @@ -675,9 +678,24 @@ Map::~Map() void Map::optionChanged(const std::string &value) { if (value == "OverlayDetail") + { mOverlayDetail = config.getIntValue("OverlayDetail"); + } else if (value == "guialpha") + { mOpacity = config.getFloatValue("guialpha"); + if (mOpacity != 1.0f) + mBeingOpacity = config.getBoolValue("beingopacity"); + else + mBeingOpacity = false; + } + else if (value == "beingopacity") + { + if (mOpacity != 1.0f) + mBeingOpacity = config.getBoolValue("beingopacity"); + else + mBeingOpacity = false; + } } void Map::initializeAmbientLayers() @@ -895,7 +913,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) } // Dont draw if gui opacity == 1 - if (mOpacity != 1.0f) + if (mBeingOpacity && mOpacity != 1.0f) { // Draws beings with a lower opacity to make them visible // even when covered by a wall or some other elements... -- cgit v1.2.3-70-g09d2