|
|
@ -859,6 +859,17 @@ std::vector<std::string>::iterator MwIniImporter::findString(std::vector<std::st
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MwIniImporter::addPaths(std::vector<boost::filesystem::path>& output, std::vector<std::string> input) {
|
|
|
|
|
|
|
|
for (auto& path : input) {
|
|
|
|
|
|
|
|
if (path.front() == '"')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
path.erase(path.begin());
|
|
|
|
|
|
|
|
path.erase(path.end() - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
output.emplace_back(path);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, const boost::filesystem::path& iniFilename) const
|
|
|
|
void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, const boost::filesystem::path& iniFilename) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::vector<std::pair<std::time_t, boost::filesystem::path>> contentFiles;
|
|
|
|
std::vector<std::pair<std::time_t, boost::filesystem::path>> contentFiles;
|
|
|
@ -869,17 +880,11 @@ void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, co
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<boost::filesystem::path> dataPaths;
|
|
|
|
std::vector<boost::filesystem::path> dataPaths;
|
|
|
|
if (cfg.count("data"))
|
|
|
|
if (cfg.count("data"))
|
|
|
|
{
|
|
|
|
addPaths(dataPaths, cfg["data"]);
|
|
|
|
for (std::string filePathString : cfg["data"])
|
|
|
|
|
|
|
|
{
|
|
|
|
if (cfg.count("data-local"))
|
|
|
|
if (filePathString.front() == '"')
|
|
|
|
addPaths(dataPaths, cfg["data-local"]);
|
|
|
|
{
|
|
|
|
|
|
|
|
filePathString.erase(filePathString.begin());
|
|
|
|
|
|
|
|
filePathString.erase(filePathString.end() - 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dataPaths.emplace_back(filePathString);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dataPaths.push_back(iniFilename.parent_path() /= "Data Files");
|
|
|
|
dataPaths.push_back(iniFilename.parent_path() /= "Data Files");
|
|
|
|
|
|
|
|
|
|
|
|
multistrmap::const_iterator it = ini.begin();
|
|
|
|
multistrmap::const_iterator it = ini.begin();
|
|
|
|