mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
commit
fa0b911be7
@ -106,7 +106,7 @@ void ChroniclesExtractor::createBaseMod() const
|
|||||||
{ "author", "3DO" },
|
{ "author", "3DO" },
|
||||||
{ "version", "1.0" },
|
{ "version", "1.0" },
|
||||||
{ "contact", "vcmi.eu" },
|
{ "contact", "vcmi.eu" },
|
||||||
{ "heroes", QJsonArray({"config/heroes/portraitsChronicles.json"}) },
|
{ "heroes", QJsonArray({"config/portraitsChronicles.json"}) },
|
||||||
{ "settings", QJsonObject({{"mapFormat", QJsonObject({{"chronicles", QJsonObject({{
|
{ "settings", QJsonObject({{"mapFormat", QJsonObject({{"chronicles", QJsonObject({{
|
||||||
{"supported", true},
|
{"supported", true},
|
||||||
{"portraits", QJsonObject({
|
{"portraits", QJsonObject({
|
||||||
@ -123,6 +123,21 @@ void ChroniclesExtractor::createBaseMod() const
|
|||||||
QFile jsonFile(dir.filePath("mod.json"));
|
QFile jsonFile(dir.filePath("mod.json"));
|
||||||
jsonFile.open(QFile::WriteOnly);
|
jsonFile.open(QFile::WriteOnly);
|
||||||
jsonFile.write(QJsonDocument(mod).toJson());
|
jsonFile.write(QJsonDocument(mod).toJson());
|
||||||
|
|
||||||
|
for(auto & dataPath : VCMIDirs::get().dataPaths())
|
||||||
|
{
|
||||||
|
auto file = dataPath / "config" / "heroes" / "portraitsChronicles.json";
|
||||||
|
auto destFolder = VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "content" / "config";
|
||||||
|
if(boost::filesystem::exists(file))
|
||||||
|
{
|
||||||
|
boost::filesystem::create_directories(destFolder);
|
||||||
|
#if BOOST_VERSION >= 107400
|
||||||
|
boost::filesystem::copy_file(file, destFolder / "portraitsChronicles.json", boost::filesystem::copy_options::overwrite_existing);
|
||||||
|
#else
|
||||||
|
boost::filesystem::copy_file(file, destFolder / "portraitsChronicles.json", boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChroniclesExtractor::createChronicleMod(int no)
|
void ChroniclesExtractor::createChronicleMod(int no)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user