Added h3m strings generation to 'convert txt' command

This commit is contained in:
Ivan Savenko committed 2023-03-14 17:54:37 +02:00
1 parent 6c693f2920
commit a4ef9fd0b8
2 files changed
+41 -2

No files matched your search

+26
View File
@@ -23,6 +23,9 @@
#include "../lib/CGameState.h"
#include "../lib/CPlayerState.h"
#include "../lib/StringConstants.h"
#include "../lib/mapping/CMapService.h"
#include "../lib/mapping/CMap.h"
#include "../lib/mapping/CCampaignHandler.h"
#include "windows/CCastleInterface.h"
#include "render/CAnimation.h"
#include "../CCallback.h"
@@ -153,6 +156,29 @@ void ClientCommandManager::processCommand(const std::string &message, bool calle
// }
else if(message=="convert txt")
{
std::unordered_set<ResourceID> mapList = CResourceHandler::get()->getFilteredFiles([&](const ResourceID & ident)
{
return ident.getType() == EResType::MAP;
});
//std::unordered_set<ResourceID> campaignList = CResourceHandler::get()->getFilteredFiles([&](const ResourceID & ident)
//{
// return ident.getType() == EResType::CAMPAIGN;
//});
CMapService mapService;
for (auto const & mapName : mapList)
mapService.loadMap(mapName); // load and drop loaded map - we only need loader to run over all maps
// TODO:
//for (auto const & campaignName : campaignList)
//{
// CCampaignState state(CCampaignHandler::getCampaign(campaignName.getName()));
// for (auto const & part : state.camp->mapPieces)
// delete state.getMap(part.first);
//}
VLC->generaltexth->dumpAllTexts();
}
else if(message=="get config")