diff --git a/client/lobby/SelectionTab.cpp b/client/lobby/SelectionTab.cpp index a8111ed03..5e9e3fbc5 100644 --- a/client/lobby/SelectionTab.cpp +++ b/client/lobby/SelectionTab.cpp @@ -787,6 +787,8 @@ bool SelectionTab::isMapSupported(const CMapInfo & info) return CGI->settings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["supported"].Bool(); case EMapFormat::SOD: return CGI->settings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["supported"].Bool(); + case EMapFormat::CHR: + return CGI->settings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["supported"].Bool(); case EMapFormat::WOG: return CGI->settings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["supported"].Bool(); case EMapFormat::HOTA: diff --git a/config/gameConfig.json b/config/gameConfig.json index 231185998..0153b936d 100644 --- a/config/gameConfig.json +++ b/config/gameConfig.json @@ -271,6 +271,19 @@ "portraitYoungYog" : 162 } }, + "chronicles" : { + "supported" : true, + "iconIndex" : 2, + + "portraits" : { + "portraitTarnumBarbarian" : 137, + "portraitTarnumKnight" : 138, + "portraitTarnumWizard" : 139, + "portraitTarnumRanger" : 140, + "portraitTarnumOverlord" : 141, + "portraitTarnumBeastmaster" : 142 + } + }, "jsonVCMI" : { "supported" : true, "iconIndex" : 3 diff --git a/config/heroes/portraits.json b/config/heroes/portraits.json index d1fa147aa..77d1ce6ad 100644 --- a/config/heroes/portraits.json +++ b/config/heroes/portraits.json @@ -202,5 +202,71 @@ ], "skills" : [], "specialty" : {} + }, + "portraitTarnumBarbarian" : + { + "class" : "barbarian", + "special" : false, + "images": { + "large" : "Hc_HPL137", + "small" : "Hc_HPS137", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } + }, + "portraitTarnumKnight" : + { + "class" : "knight", + "special" : false, + "images": { + "large" : "Hc_HPL138", + "small" : "Hc_HPS138", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } + }, + "portraitTarnumWizard" : + { + "class" : "wizard", + "special" : false, + "images": { + "large" : "Hc_HPL139", + "small" : "Hc_HPS139", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } + }, + "portraitTarnumRanger" : + { + "class" : "ranger", + "special" : false, + "images": { + "large" : "Hc_HPL140", + "small" : "Hc_HPS140", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } + }, + "portraitTarnumOverlord" : + { + "class" : "overlord", + "special" : false, + "images": { + "large" : "Hc_HPL141", + "small" : "Hc_HPS141", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } + }, + "portraitTarnumBeastmaster" : + { + "class" : "beastmaster", + "special" : false, + "images": { + "large" : "Hc_HPL142", + "small" : "Hc_HPS142", + "specialtySmall" : "default", + "specialtyLarge" : "default" + } } } \ No newline at end of file diff --git a/launcher/modManager/chroniclesextractor.cpp b/launcher/modManager/chroniclesextractor.cpp index 83ef40a72..2d461eb5f 100644 --- a/launcher/modManager/chroniclesextractor.cpp +++ b/launcher/modManager/chroniclesextractor.cpp @@ -208,8 +208,12 @@ void ChroniclesExtractor::extractFiles(int no) auto rename = [no](QDir dest){ dest.refresh(); for(auto & entry : dest.entryList()) + { + if(entry.startsWith("HPS")) + dest.rename(entry, "Hc_" + entry); if(!entry.startsWith("Hc" + QString::number(no) + "_")) dest.rename(entry, "Hc" + QString::number(no) + "_" + entry); + } }; extract(tmpDir, outDirData, "xBitmap.lod"); @@ -229,7 +233,7 @@ void ChroniclesExtractor::extractFiles(int no) tmpDir.cdUp(); QDir tmpDirData = tmpDir.filePath(tmpDir.entryList({"data"}, QDir::Filter::Dirs).front()); - extract(tmpDirData, outDirData, "bitmap.lod", std::vector{"HPL003sh", "HPL102br", "HPL139", "HPS006kn", "HPS137", "HPS141", "HPL004sh", "hpl112bs", "HPL140", "hps007sh", "HPS138", "HPS142", "HPL006kn", "HPL137", "HPS003sh", "HPS102br", "HPS139", "HPS143", "hpl007sh", "HPL138", "HPS004sh", "hps112bs", "HPS140"}); + extract(tmpDirData, outDirData, "bitmap.lod", std::vector{"HPS137", "HPS138", "HPL139", "HPS140", "HPS141", "HPS142", "HPL137", "HPL138", "HPL139", "HPL140", "HPL141", "HPL142"}); extract(tmpDirData, outDirData, "lbitmap.lod", std::vector{"INTRORIM"}); rename(outDirData); diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index 191cea455..eb671ff39 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -845,7 +845,7 @@ void CModListView::installFiles(QStringList files) auto futureExtract = std::async(std::launch::async, [this, exe, &prog]() { - ChroniclesExtractor ce(this, [this, &prog](float progress) { prog = progress; }); + ChroniclesExtractor ce(this, [&prog](float progress) { prog = progress; }); ce.installChronicles(exe); return true; }); diff --git a/lib/GameSettings.cpp b/lib/GameSettings.cpp index 77c6b3c66..b10ddf504 100644 --- a/lib/GameSettings.cpp +++ b/lib/GameSettings.cpp @@ -79,6 +79,7 @@ void GameSettings::load(const JsonNode & input) {EGameSettings::MAP_FORMAT_RESTORATION_OF_ERATHIA, "mapFormat", "restorationOfErathia" }, {EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE, "mapFormat", "armageddonsBlade" }, {EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH, "mapFormat", "shadowOfDeath" }, + {EGameSettings::MAP_FORMAT_CHRONICLES, "mapFormat", "chronicles" }, {EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS, "mapFormat", "hornOfTheAbyss" }, {EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS, "mapFormat", "inTheWakeOfGods" }, {EGameSettings::MAP_FORMAT_JSON_VCMI, "mapFormat", "jsonVCMI" }, diff --git a/lib/GameSettings.h b/lib/GameSettings.h index bcd8151f7..b1b4e8940 100644 --- a/lib/GameSettings.h +++ b/lib/GameSettings.h @@ -58,6 +58,7 @@ enum class EGameSettings MAP_FORMAT_RESTORATION_OF_ERATHIA, MAP_FORMAT_ARMAGEDDONS_BLADE, MAP_FORMAT_SHADOW_OF_DEATH, + MAP_FORMAT_CHRONICLES, MAP_FORMAT_HORN_OF_THE_ABYSS, MAP_FORMAT_JSON_VCMI, MAP_FORMAT_IN_THE_WAKE_OF_GODS, diff --git a/lib/mapping/CMapInfo.cpp b/lib/mapping/CMapInfo.cpp index 2100bcca8..58e37de88 100644 --- a/lib/mapping/CMapInfo.cpp +++ b/lib/mapping/CMapInfo.cpp @@ -172,6 +172,8 @@ int CMapInfo::getMapSizeFormatIconId() const return VLC->settings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["iconIndex"].Integer(); case EMapFormat::SOD: return VLC->settings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["iconIndex"].Integer(); + case EMapFormat::CHR: + return VLC->settings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["iconIndex"].Integer(); case EMapFormat::WOG: return VLC->settings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["iconIndex"].Integer(); case EMapFormat::HOTA: diff --git a/lib/mapping/MapFeaturesH3M.cpp b/lib/mapping/MapFeaturesH3M.cpp index e232cd6f1..df4eb6c4c 100644 --- a/lib/mapping/MapFeaturesH3M.cpp +++ b/lib/mapping/MapFeaturesH3M.cpp @@ -112,6 +112,9 @@ MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesSOD() MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesCHR() { MapFormatFeaturesH3M result = getFeaturesSOD(); + result.levelCHR = true; + + result.heroesPortraitsCount = 169; // +6x tarnum return result; } diff --git a/lib/mapping/MapFeaturesH3M.h b/lib/mapping/MapFeaturesH3M.h index 48a5382b8..4768f0746 100644 --- a/lib/mapping/MapFeaturesH3M.h +++ b/lib/mapping/MapFeaturesH3M.h @@ -65,6 +65,7 @@ public: bool levelROE = false; bool levelAB = false; bool levelSOD = false; + bool levelCHR = false; bool levelWOG = false; bool levelHOTA0 = false; bool levelHOTA1 = false; diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index c295dd091..9c54a16bc 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/lib/mapping/MapFormatH3M.cpp @@ -135,6 +135,8 @@ static MapIdentifiersH3M generateMapping(EMapFormat format) identifierMapper.loadMapping(VLC->settings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)); if(features.levelSOD) identifierMapper.loadMapping(VLC->settings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)); + if(features.levelCHR) + identifierMapper.loadMapping(VLC->settings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)); if(features.levelWOG) identifierMapper.loadMapping(VLC->settings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)); if(features.levelHOTA0)