summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-12 00:18:57 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-12 00:51:22 +0300
commitd5a00a320043f5782ebc489285c89943b667e094 (patch)
treeeb64f3b1f81f7ba2a3c7ff9e02ad329ef21abb83 /src/gui/windows
parent742b2a22bdcb69e6f615a284065ba2696e7bc261 (diff)
downloadmanaverse-d5a00a320043f5782ebc489285c89943b667e094.tar.gz
manaverse-d5a00a320043f5782ebc489285c89943b667e094.tar.bz2
manaverse-d5a00a320043f5782ebc489285c89943b667e094.tar.xz
manaverse-d5a00a320043f5782ebc489285c89943b667e094.zip
Add skipError parameter to loadXml functions.
This allow not show errors for some not main xml files.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/questswindow.cpp13
-rw-r--r--src/gui/windows/questswindow.h3
-rw-r--r--src/gui/windows/skilldialog.cpp15
-rw-r--r--src/gui/windows/skilldialog.h4
4 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index eed82636b..c75fde58f 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -125,8 +125,8 @@ QuestsWindow::QuestsWindow() :
loadWindowState();
enableVisibleSound(true);
- loadXmlFile(paths.getStringValue("questsFile"));
- loadXmlFile(paths.getStringValue("questsPatchFile"));
+ loadXmlFile(paths.getStringValue("questsFile"), SkipError_false);
+ loadXmlFile(paths.getStringValue("questsPatchFile"), SkipError_true);
loadXmlDir("questsPatchDir", loadXmlFile);
}
@@ -162,9 +162,12 @@ QuestsWindow::~QuestsWindow()
}
}
-void QuestsWindow::loadXmlFile(const std::string &fileName)
+void QuestsWindow::loadXmlFile(const std::string &fileName,
+ const SkipError skipError)
{
- XML::Document doc(fileName, UseResman_true, SkipError_false);
+ XML::Document doc(fileName,
+ UseResman_true,
+ skipError);
const XmlNodePtrConst root = doc.rootNode();
if (!root)
return;
@@ -175,7 +178,7 @@ void QuestsWindow::loadXmlFile(const std::string &fileName)
{
const std::string name = XML::getProperty(varNode, "name", "");
if (!name.empty())
- loadXmlFile(name);
+ loadXmlFile(name, skipError);
continue;
}
else if (xmlNameEqual(varNode, "var"))
diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h
index 1012e813a..ec2f7da42 100644
--- a/src/gui/windows/questswindow.h
+++ b/src/gui/windows/questswindow.h
@@ -72,7 +72,8 @@ class QuestsWindow final : public Window,
void addEffect(Being *const being);
private:
- void loadXmlFile(const std::string &fileName);
+ void loadXmlFile(const std::string &fileName,
+ const SkipError skipError);
void loadQuest(const int var, const XmlNodePtr node);
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index a11e0b5aa..b61afb70f 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -266,18 +266,21 @@ void SkillDialog::hideSkills(const SkillOwner::Type owner)
void SkillDialog::loadSkills()
{
clearSkills();
- loadXmlFile(paths.getStringValue("skillsFile"));
+ loadXmlFile(paths.getStringValue("skillsFile"), SkipError_false);
if (mSkills.empty())
- loadXmlFile(paths.getStringValue("skillsFile2"));
- loadXmlFile(paths.getStringValue("skillsPatchFile"));
+ loadXmlFile(paths.getStringValue("skillsFile2"), SkipError_false);
+ loadXmlFile(paths.getStringValue("skillsPatchFile"), SkipError_true);
loadXmlDir("skillsPatchDir", loadXmlFile);
update();
}
-void SkillDialog::loadXmlFile(const std::string &fileName)
+void SkillDialog::loadXmlFile(const std::string &fileName,
+ const SkipError skipError)
{
- XML::Document doc(fileName, UseResman_true, SkipError_false);
+ XML::Document doc(fileName,
+ UseResman_true,
+ skipError);
XmlNodePtrConst root = doc.rootNode();
int setCount = 0;
@@ -294,7 +297,7 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
{
const std::string name = XML::getProperty(set, "name", "");
if (!name.empty())
- loadXmlFile(name);
+ loadXmlFile(name, skipError);
continue;
}
else if (xmlNameEqual(set, "set"))
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index 910ba9b72..146b67bab 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -26,6 +26,7 @@
#include "gui/widgets/window.h"
#include "enums/simpletypes/autotarget.h"
+#include "enums/simpletypes/skiperror.h"
#include "enums/simpletypes/modifiable.h"
#include "listeners/actionlistener.h"
@@ -77,7 +78,8 @@ class SkillDialog final : public Window,
void updateModels();
- void loadXmlFile(const std::string &fileName);
+ void loadXmlFile(const std::string &fileName,
+ const SkipError skipError);
void clearSkills();