summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/questswindow.cpp15
-rw-r--r--src/gui/windows/questswindow.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index 0cd04dbc1..ec40f759f 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -181,7 +181,7 @@ QuestsWindow::QuestsWindow() :
loadWindowState();
enableVisibleSound(true);
- loadXml();
+ loadXmlFile(paths.getStringValue("questsFile"));
}
QuestsWindow::~QuestsWindow()
@@ -218,16 +218,23 @@ QuestsWindow::~QuestsWindow()
}
}
-void QuestsWindow::loadXml()
+void QuestsWindow::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(paths.getStringValue("questsFile"));
+ XML::Document doc(fileName);
const XmlNodePtr root = doc.rootNode();
if (!root)
return;
for_each_xml_child_node(varNode, root)
{
- if (xmlNameEqual(varNode, "var"))
+ if (xmlNameEqual(varNode, "include"))
+ {
+ const std::string name = XML::getProperty(varNode, "name", "");
+ if (!name.empty())
+ loadXmlFile(name);
+ continue;
+ }
+ else if (xmlNameEqual(varNode, "var"))
{
const int id = XML::getProperty(varNode, "id", 0);
if (id < 0)
diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h
index 5b008e93e..7ecc86c84 100644
--- a/src/gui/windows/questswindow.h
+++ b/src/gui/windows/questswindow.h
@@ -72,7 +72,7 @@ class QuestsWindow final : public Window,
void addEffect(Being *const being);
private:
- void loadXml();
+ void loadXmlFile(const std::string &fileName);
void loadQuest(const int var, const XmlNodePtr node);