diff options
author | Przemysław Grzywacz <nexather@gmail.com> | 2013-05-22 16:04:19 +0200 |
---|---|---|
committer | Przemysław Grzywacz <nexather@gmail.com> | 2013-05-22 16:04:19 +0200 |
commit | f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d (patch) | |
tree | 9a9825a138b1e1c0e383b4a187fcf2f0d24a247f | |
parent | 64520d5f1f3c124435797fccae9b68be69e04133 (diff) | |
download | mana-client-f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d.tar.gz mana-client-f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d.tar.bz2 mana-client-f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d.tar.xz mana-client-f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d.zip |
paths.xml content is now read from settings.xml
-rw-r--r-- | src/client.cpp | 3 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 12 | ||||
-rw-r--r-- | src/resources/settingsmanager.cpp | 17 |
3 files changed, 21 insertions, 11 deletions
diff --git a/src/client.cpp b/src/client.cpp index 6b8ebca1..92c8c63a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -755,9 +755,6 @@ int Client::exec() false); } - // Read default paths file 'data/paths.xml' - paths.init("paths.xml", true); - // TODO remove this as soon as inventoryhandler stops using this event Event::trigger(Event::ClientChannel, Event::LoadingDatabases); diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index b802457e..8c1a8d15 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -326,9 +326,6 @@ void TaItemDB::init() { if (mLoaded) unload(); - - mUnknown = new TaItemInfo; - loadEmptyItemDefinition(); } void TaItemDB::readItemNode(xmlNodePtr node, const std::string &filename) @@ -376,6 +373,9 @@ void TaItemDB::readItemNode(xmlNodePtr node, const std::string &filename) void TaItemDB::checkStatus() { + mUnknown = new TaItemInfo; + loadEmptyItemDefinition(); + checkHairWeaponsRacesSpecialIds(); mLoaded = true; @@ -417,9 +417,6 @@ void ManaServItemDB::init() // Initialize the trigger table for effect descriptions initTriggerTable(); - - mUnknown = new ManaServItemInfo; - loadEmptyItemDefinition(); } void ManaServItemDB::readItemNode(xmlNodePtr node, const std::string &filename) @@ -530,6 +527,9 @@ void ManaServItemDB::readItemNode(xmlNodePtr node, const std::string &filename) void ManaServItemDB::checkStatus() { + mUnknown = new ManaServItemInfo; + loadEmptyItemDefinition(); + mLoaded = true; } diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp index b2d1fe80..940ebb59 100644 --- a/src/resources/settingsmanager.cpp +++ b/src/resources/settingsmanager.cpp @@ -20,6 +20,7 @@ #include "resources/settingsmanager.h" +#include "configuration.h" #include "resources/attributes.h" #include "resources/hairdb.h" #include "resources/itemdb.h" @@ -39,14 +40,15 @@ namespace SettingsManager { - std::string mSettingsFile; - std::set<std::string> mIncludedFiles; + static std::string mSettingsFile; + static std::set<std::string> mIncludedFiles; static void loadFile(const std::string &filename); void load() { // initialize managers + paths.clear(); Attributes::init(); hairDB.init(); itemDb->init(); @@ -140,6 +142,17 @@ namespace SettingsManager } } } + else if (xmlStrEqual(childNode->name, BAD_CAST "option")) + { + // options from paths.xml + std::string name = XML::getProperty(childNode, "name", std::string()); + std::string value = XML::getProperty(childNode, "value", std::string()); + + if (!name.empty()) + paths.setValue(name, value); + else + logger->log("Warning: option without a name found in %s", filename.c_str()); + } else if (xmlStrEqual(childNode->name, BAD_CAST "attribute")) { // map config |