Skip to content

Commit

Permalink
Use the Terra Indomita province mappings for the I:R Antiquitas mod (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Dec 16, 2024
1 parent c1844ab commit 18af079
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ImperatorToCK3.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
<s:Boolean x:Key="/Default/Environment/Filtering/ExcludeCoverageFilters/=Fronter_003B_002A_003B_002A_003B_002A/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=adjacencies/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Adnanite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=aegyptian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Alexandros/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=angeBy/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Antigonid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=antiquitas/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=apulia/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=aquitane/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=arberian/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -42,6 +44,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=configurables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cornelli/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cuman/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cyrenaican/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=datacontext/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Defs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=diadochi/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -66,10 +69,13 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=IMPERATOR/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=IMPTOCK/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Incontinentia/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=indomita/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=instabuild/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Invicta/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=invictus/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=IRTOCK/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=italia/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=italiotian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jailor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=jailors/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jure/@EntryIndexedValue">True</s:Boolean>
Expand Down Expand Up @@ -98,6 +104,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Petair/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phrygian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Playset/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pontic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pontifex/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Provs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Qahtanite/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -115,6 +122,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=shudra/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=simp/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=slovien/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=syracusan/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tengri/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=toogle/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Travellers/@EntryIndexedValue">True</s:Boolean>
Expand Down
13 changes: 7 additions & 6 deletions ImperatorToCK3/CK3/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public World(Imperator.World impWorld, Configuration config, Thread? irCoaExtrac
ColorFactory ck3ColorFactory = new();
// Now that we have the mod filesystem, we can initialize the localization database.
Parallel.Invoke(
() => LoadCorrectProvinceMappingsFile(impWorld), // Depends on loaded mods.
() => LoadCorrectProvinceMappingsFile(impWorld, config), // Depends on loaded mods.
() => {
LocDB.LoadLocFromModFS(ModFS, config.GetActiveCK3ModFlags());
Logger.IncrementProgress();
Expand Down Expand Up @@ -425,14 +425,15 @@ private void ImportImperatorWars(Imperator.World irWorld, Date ck3BookmarkDate)
Logger.IncrementProgress();
}

private void LoadCorrectProvinceMappingsFile(Imperator.World imperatorWorld) {
private void LoadCorrectProvinceMappingsFile(Imperator.World irWorld, Configuration config) {
string mappingsToUse;

bool irHasTI = imperatorWorld.Countries.Any(c => c.Variables.Contains("unification_points"));
bool ck3HasAEP = LoadedMods.Any(m => m.Name == "Asia Expansion Project");
if (irHasTI && ck3HasAEP) {
// Terra Indomita mappings should be used if either TI or Antiquitas is detected.
bool irHasTI = irWorld.Countries.Any(c => c.Variables.Contains("unification_points")) || irWorld.UsableMods.Any(m => m.Name == "Antiquitas");

if (irHasTI && config.AsiaExpansionProjectEnabled) {
mappingsToUse = "terra_indomita_to_aep";
} else if (imperatorWorld.GlobalFlags.Contains("is_playing_invictus")) {
} else if (irWorld.GlobalFlags.Contains("is_playing_invictus")) {
mappingsToUse = "imperator_invictus";
} else {
mappingsToUse = "imperator_vanilla";
Expand Down
5 changes: 4 additions & 1 deletion ImperatorToCK3/Data_Files/configurables/culture_map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ link = { ck3=somali
## Meroitic
# TFE
link = { ck3=meroitic ir=meroitic ir=alutan }
link = { ck3=meroitic ck3=cushite } # Cushitic is from I:R Antiquitas mod.
# vanilla CK3
link = { ck3=nubian ir=meroitic }
link = { ck3=nubian ir=cushite }
# Invictus mod
link = { ck3=nubian ir=nubian ir=lower_nubian ir=napatan ir=moyan ir=alutan }

Expand Down Expand Up @@ -428,7 +430,8 @@ link = { ck3 = german @ir_all_germanic_cultures }


## Hellenic
@ir_greek_cultures = "ir=greek ir=athenian ir=peloponnesian ir=massalian ir=cyrenaican ir=bosporan ir=thessalian ir=cypriot ir=bithynian ir=ionian ir=troan ir=aeolian ir=greco_pontic ir=aegean ir=aetolian ir=euboean ir=boeotian ir=epirote ir=arcadian ir=argolian ir=parthinian ir=cretan ir=achaean ir=enetoian"
@ir_antiquitas_greek_cultures="ir=doric ir=north_western_doric ir=attican ir=western_ionic ir=eastern_ionic ir=eteocretan ir=elean ir=kerkyran" # # Antiquitas (https://steamcommunity.com/sharedfiles/filedetails/?id=2992438857)
@ir_greek_cultures = "ir=greek ir=athenian ir=peloponnesian ir=massalian ir=cyrenaican ir=bosporan ir=thessalian ir=cypriot ir=bithynian ir=ionian ir=troan ir=aeolian ir=greco_pontic ir=aegean ir=aetolian ir=euboean ir=boeotian ir=epirote ir=arcadian ir=argolian ir=parthinian ir=cretan ir=achaean ir=enetoian @ir_antiquitas_greek_cultures"
# TFE
link = { ck3 = pontic ir = greco_pontic }
link = { ck3 = syrian ir=macedonian ir=hellenistic ir=syracusan ir=thracian @ir_greek_cultures @culture_splitting_region_N }
Expand Down
3 changes: 3 additions & 0 deletions ImperatorToCK3/Imperator/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ internal partial class World {
private GenesDB genesDB = new();
public InventionsDB InventionsDB { get; } = new();
public ColorFactory ColorFactory { get; } = new();

public IReadOnlyList<Mod> UsableMods { get; private set; } = Array.Empty<Mod>();

private enum SaveType { Invalid, Plaintext, CompressedEncoded }
private SaveType saveType = SaveType.Invalid;
Expand Down Expand Up @@ -335,6 +337,7 @@ private void ParseSave(Configuration config, ConverterVersion converterVersion,
// Let's locate, verify and potentially update those mods immediately.
ModLoader modLoader = new();
modLoader.LoadMods(config.ImperatorDocPath, incomingMods);
UsableMods = new Mods(modLoader.UsableMods);
ModFS = new ModFilesystem(imperatorRoot, modLoader.UsableMods);

// Now that we have the list of mods used, we can load data from Imperator mod filesystem
Expand Down

0 comments on commit 18af079

Please sign in to comment.