diff options
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_visual.cpp | 6 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 17 |
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") { |