summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 6790cf61f..17ef70508 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -35,23 +35,31 @@
EffectManager::EffectManager() :
mEffects()
{
- XML::Document doc(paths.getStringValue("effectsFile"));
+ logger->log1("Effects are now loading");
+ loadXmlFile(paths.getStringValue("effectsFile"));
+}
+
+void EffectManager::loadXmlFile(const std::string &fileName)
+{
+ XML::Document doc(fileName);
const XmlNodePtr root = doc.rootNode();
if (!root || !xmlNameEqual(root, "being-effects"))
{
- logger->log("Error loading being effects file: "
- + paths.getStringValue("effectsFile"));
+ logger->log("Error loading being effects file: " + fileName);
return;
}
- else
- {
- logger->log1("Effects are now loading");
- }
for_each_xml_child_node(node, root)
{
- if (xmlNameEqual(node, "effect"))
+ if (xmlNameEqual(node, "include"))
+ {
+ const std::string name = XML::getProperty(node, "name", "");
+ if (!name.empty())
+ loadXmlFile(name);
+ continue;
+ }
+ else if (xmlNameEqual(node, "effect"))
{
mEffects.push_back(EffectDescription(
XML::getProperty(node, "id", -1),