summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-08 18:04:00 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-08 18:04:00 +0300
commit4f96bf265375b7ca580f072f5a25c8b4097fb04a (patch)
tree65faa147a7e3015931ad25f714d9aab368d98a35 /src
parentbaca54daa08332ac447793e5a4eb50abe467cc9a (diff)
downloadplus-4f96bf265375b7ca580f072f5a25c8b4097fb04a.tar.gz
plus-4f96bf265375b7ca580f072f5a25c8b4097fb04a.tar.bz2
plus-4f96bf265375b7ca580f072f5a25c8b4097fb04a.tar.xz
plus-4f96bf265375b7ca580f072f5a25c8b4097fb04a.zip
Add option for disable / enable particles effect located in map file.
Diffstat (limited to 'src')
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_visual.cpp6
-rw-r--r--src/resources/mapreader.cpp17
3 files changed, 19 insertions, 5 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index f12515789..1d88d3091 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -117,6 +117,7 @@ DefaultsData* getConfigDefaults()
AddDEF("particleFastPhysics", 1);
AddDEF("particleEmitterSkip", 1);
AddDEF("particleeffects", true);
+ AddDEF("mapparticleeffects", true);
AddDEF("logToStandardOut", false);
AddDEF("opengl", 0);
#ifdef ANDROID
diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp
index 07bb6de2f..de5cc8b3b 100644
--- a/src/gui/widgets/tabs/setup_visual.cpp
+++ b/src/gui/widgets/tabs/setup_visual.cpp
@@ -160,9 +160,13 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) :
"OverlayDetailEvent", mAmbientFxList, 100);
// TRANSLATORS: settings option
- new SetupItemCheckBox(_("Particle effects"), "",
+ new SetupItemCheckBox(_("Show particle effects"), "",
"particleeffects", this, "particleeffectsEvent");
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Show particle effects from maps"), "",
+ "mapparticleeffects", this, "mapparticleeffectsEvent");
+
// TRANSLATORS: particle details
mParticleList->push_back(_("low"));
// TRANSLATORS: particle details
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index cd5a1feb7..e6e0dc912 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -415,6 +415,7 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
const int tileOffsetY = XML::getProperty(childNode, "y", 0);
const int offsetX = tileOffsetX * tilew;
const int offsetY = tileOffsetY * tileh;
+ const bool showParticles = config.getBoolValue("mapparticleeffects");
for_each_xml_child_node(objectNode, childNode)
{
@@ -454,10 +455,18 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
continue;
}
- map->addParticleEffect(objName,
- objX + offsetX,
- objY + offsetY,
- objW, objH);
+ if (showParticles)
+ {
+ map->addParticleEffect(objName,
+ objX + offsetX,
+ objY + offsetY,
+ objW,
+ objH);
+ }
+ else
+ {
+ logger->log("Ignore particle effect: " + objName);
+ }
}
else if (objType == "WARP")
{