Skip to content

Commit

Permalink
Update revolution_target detection (ParadoxGameConverters#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemurin authored Apr 4, 2024
1 parent 7a2ce55 commit 69fdd4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions EU4ToVic2/Source/EU4World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ EU4::World::World(const mappers::IdeaEffectMapper& ideaEffectMapper, const commo

void EU4::World::registerKeys(const mappers::IdeaEffectMapper& ideaEffectMapper, const commonItems::ConverterVersion& converterVersion)
{
revolutionParser.registerKeyword("revolution_target", [this](std::istream& theStream) {
revolutionTargetString = commonItems::getString(theStream);
});
revolutionParser.registerRegex(commonItems::catchallRegex, commonItems::ignoreItem);

registerKeyword("EU4txt", [](std::istream& theStream) {
});
registerKeyword("date", [this](std::istream& theStream) {
Expand Down Expand Up @@ -272,9 +277,14 @@ void EU4::World::registerKeys(const mappers::IdeaEffectMapper& ideaEffectMapper,
}
}
});
// Old Style (up to 1.32)
registerKeyword("revolution_target", [this](std::istream& theStream) {
revolutionTargetString = commonItems::getString(theStream);
});
// New style (1.33 and onwards)
registerKeyword("revolution", [this](std::istream& theStream) {
revolutionParser.parseStream(theStream);
});
registerKeyword("celestial_empire", [this](std::istream& theStream) {
const EU4Empire empireBlock(theStream);
celestialEmperor = empireBlock.getEmperor();
Expand Down
2 changes: 2 additions & 0 deletions EU4ToVic2/Source/EU4World/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class World: commonItems::parser

// export data for hoi4
std::vector<std::pair<std::string, HistoricalEntry>> historicalData;

parser revolutionParser;
};
} // namespace EU4

Expand Down

0 comments on commit 69fdd4d

Please sign in to comment.