Skip to content

Commit

Permalink
Only give messages on missing localisations when in debug mode. (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Idhrendur authored Oct 16, 2022
1 parent 5492c2e commit a8b58ae
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 159 deletions.
125 changes: 72 additions & 53 deletions src/HOI4World/Events/Events.cpp

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions src/HOI4World/Events/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ class Events: commonItems::parser
const std::string& annexedTag,
const std::vector<int>& claimedStates);
void createTradeEvent(const Country& leader, const std::string& aggressorTag);
void createPoliticalEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void createWarJustificationEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void createPoliticalEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation, bool debug);
void createWarJustificationEvents(const std::set<std::string>& majorIdeologies,
Localisation& localisation,
bool debug);
void importElectionEvents(const std::set<std::string>& majorIdeologies, OnActions& onActions);
void addPartyChoiceEvent(const std::string& countryTag,
const std::set<Vic2::Party>& parties,
OnActions& onActions,
const std::set<std::string>& majorIdeologies,
const Vic2::Localisations& vic2Localisations,
Localisation& hoi4Localisations);
Localisation& hoi4Localisations,
bool debug);
void createStabilityEvents(const std::set<std::string>& majorIdeologies, const Configuration& theConfiguration);
void generateGenericEvents(const Configuration& theConfiguration, const std::set<std::string>& majorIdeologies);
void importCapitulationEvents(const Configuration& theConfiguration, const std::set<std::string>& majorIdeologies);
Expand Down Expand Up @@ -84,12 +87,14 @@ class Events: commonItems::parser
[[nodiscard]] const auto& getSummitNewsEventsIds() const { return summitNewsEventsIds; }

private:
void addOnTheRise(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void addMinisterRevolutionEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void addDemocraticMinisterRevolutionEvents(Localisation& localisation);
void addFiftyPercentEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void addRevolutionEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void addSuppressedEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation);
void addOnTheRise(const std::set<std::string>& majorIdeologies, Localisation& localisation, bool debug);
void addMinisterRevolutionEvents(const std::set<std::string>& majorIdeologies,
Localisation& localisation,
bool debug);
void addDemocraticMinisterRevolutionEvents(Localisation& localisation, bool debug);
void addFiftyPercentEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation, bool debug);
void addRevolutionEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation, bool debug);
void addSuppressedEvents(const std::set<std::string>& majorIdeologies, Localisation& localisation, bool debug);

static std::string getIdeologicalPicture(const std::string& ideology);

Expand Down
4 changes: 2 additions & 2 deletions src/HOI4World/HoI4Country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,9 +1634,9 @@ void HoI4::Country::transferPuppets(const std::set<std::shared_ptr<Country>>& tr
}


void HoI4::Country::addPuppetsIntegrationTree(HoI4::Localisation& hoi4Localisations)
void HoI4::Country::addPuppetsIntegrationTree(HoI4::Localisation& hoi4Localisations, bool debug)
{
nationalFocus->addIntegratePuppetsBranch(tag, puppets, hoi4Localisations);
nationalFocus->addIntegratePuppetsBranch(tag, puppets, hoi4Localisations, debug);
}


Expand Down
2 changes: 1 addition & 1 deletion src/HOI4World/HoI4Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Country
const Regions& theRegions);
void addEmptyFocusTree();
void addGenericFocusTree(const std::set<std::string>& majorIdeologies);
void addPuppetsIntegrationTree(HoI4::Localisation& hoi4Localisations);
void addPuppetsIntegrationTree(HoI4::Localisation& hoi4Localisations, bool debug);
void addFocusTreeBranch(const std::string& branch, OnActions& onActions);
void adjustResearchFocuses() const;

Expand Down
5 changes: 3 additions & 2 deletions src/HOI4World/HoI4Focus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ std::shared_ptr<HoI4Focus> HoI4Focus::makeCustomizedCopy(const std::string& coun

std::shared_ptr<HoI4Focus> HoI4Focus::makeTargetedCopy(const std::string& country,
const std::string& target,
HoI4::Localisation& localisation) const
HoI4::Localisation& localisation,
bool debug) const
{
auto newFocus = std::make_shared<HoI4Focus>(*this);

newFocus->text = id + target;
localisation.copyFocusLocalisations(newFocus->id, newFocus->text);
localisation.copyFocusLocalisations(newFocus->id, newFocus->text, debug);
localisation.updateLocalisationText(newFocus->text, "$TARGET", target);
localisation.updateLocalisationText(newFocus->text + "_desc", "$TARGET", target);
newFocus->id += country + target;
Expand Down
3 changes: 2 additions & 1 deletion src/HOI4World/HoI4Focus.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class HoI4Focus: commonItems::parser
std::shared_ptr<HoI4Focus> makeCustomizedCopy(const std::string& country) const;
std::shared_ptr<HoI4Focus> makeTargetedCopy(const std::string& country,
const std::string& target,
HoI4::Localisation& localisation) const;
HoI4::Localisation& localisation,
bool debug) const;

void updateFocusElement(std::string& element,
std::string_view oldText,
Expand Down
Loading

0 comments on commit a8b58ae

Please sign in to comment.