-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement mappings loading in ArtifactVisualsMapper
- Loading branch information
1 parent
81a5e71
commit b8d8a98
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -682,6 +682,7 @@ public void ImportArtifacts( | |
ModifierMapper modifierMapper, | ||
ModifierCollection ck3Modifiers, | ||
LocDB irLocDB, | ||
CK3LocDB ck3LocDB, | ||
Date date | ||
) { | ||
Logger.Info("Importing Imperator artifacts..."); | ||
|
@@ -750,7 +751,7 @@ Date date | |
// TODO: try to use create_artifact_sculpture_babr_e_bayan_effect as base | ||
Check warning on line 751 in ImperatorToCK3/CK3/Characters/CharacterCollection.cs GitHub Actions / Upload development build (linux-x64)
|
||
foreach (var irArtifactId in irArtifactIds) { | ||
var irArtifact = treasureManager[irArtifactId]; | ||
ImportArtifact(character, irArtifact, modifierMapper, ck3Modifiers, irLocDB, date); | ||
ImportArtifact(character, irArtifact, modifierMapper, ck3Modifiers, irLocDB, ck3LocDB, date); | ||
} | ||
|
||
|
||
|
@@ -784,21 +785,23 @@ Date date | |
Logger.IncrementProgress(); | ||
} | ||
|
||
private void ImportArtifact(Character character, Treasure irArtifact, ModifierMapper modifierMapper, ModifierCollection ck3Modifiers, LocDB irLocDB, Date date) { | ||
private void ImportArtifact(Character character, Treasure irArtifact, ModifierMapper modifierMapper, ModifierCollection ck3Modifiers, LocDB irLocDB, CK3LocDB ck3LocDB, Date date) { | ||
var ck3ArtifactName = $"IRToCK3_artifact_{irArtifact.Key}_{irArtifact.Id}"; | ||
var irNameLoc = irLocDB.GetLocBlockForKey(irArtifact.Key); | ||
if (irNameLoc is null) { | ||
Logger.Warn($"Can't find name loc for artifact {irArtifact.Key}!"); | ||
} else { | ||
character.Localizations.Add(ck3ArtifactName, new LocBlock(ck3ArtifactName, irNameLoc)); | ||
var artifactNameLocBlock = ck3LocDB.GetOrCreateLocBlock(ck3ArtifactName); | ||
artifactNameLocBlock.CopyFrom(irNameLoc); | ||
} | ||
|
||
var ck3DescKey = $"{ck3ArtifactName}_desc"; | ||
var irDescLoc = irLocDB.GetLocBlockForKey(irArtifact.Key + "_desc"); | ||
if (irDescLoc is null) { | ||
Logger.Warn($"Can't find description loc for artifact {irArtifact.Key}!"); | ||
} else { | ||
character.Localizations.Add(ck3DescKey, new LocBlock(ck3DescKey, irDescLoc)); | ||
var descLocBlock = ck3LocDB.GetOrCreateLocBlock(ck3DescKey); | ||
descLocBlock.CopyFrom(irDescLoc); | ||
} | ||
|
||
var artifactScope = $"newly_created_artifact_{irArtifact.Id}"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters