summaryrefslogtreecommitdiff
path: root/src/resources/db/sounddb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db/sounddb.cpp')
-rw-r--r--src/resources/db/sounddb.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp
index 639156909..ca7d0d654 100644
--- a/src/resources/db/sounddb.cpp
+++ b/src/resources/db/sounddb.cpp
@@ -37,8 +37,12 @@ namespace
void SoundDB::load()
{
unload();
+ loadXmlFile(paths.getStringValue("soundsFile"));
+}
- XML::Document *doc = new XML::Document(paths.getStringValue("soundsFile"));
+void SoundDB::loadXmlFile(const std::string &fileName)
+{
+ XML::Document *doc = new XML::Document(fileName);
const XmlNodePtr root = doc->rootNode();
if (!root || !xmlNameEqual(root, "sounds"))
@@ -49,7 +53,14 @@ void SoundDB::load()
for_each_xml_child_node(node, root)
{
- if (xmlNameEqual(node, "sound"))
+ if (xmlNameEqual(node, "include"))
+ {
+ const std::string name = XML::getProperty(node, "name", "");
+ if (!name.empty())
+ loadXmlFile(name);
+ continue;
+ }
+ else if (xmlNameEqual(node, "sound"))
{
const std::string name = XML::getProperty(node, "name", "");
const int id = NotifyManager::getIndexBySound(name);