Skip to content

Commit

Permalink
Fix bookmark character name not being outputted
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains committed Jan 20, 2025
1 parent 3e3ddee commit 6412969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Localization/CK3LocBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void CopyFrom(LocBlock otherBlock) {

public void CopyFrom(CK3LocBlock otherBlock) {
foreach (var (language, loc) in otherBlock.localizations) {
localizations[language] = loc;
localizations[language] = (loc.Item1, CK3LocType.ConverterGenerated);
}
}

Expand Down
9 changes: 5 additions & 4 deletions ImperatorToCK3/Outputter/BookmarkOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ Configuration config

// Add character localization for bookmark screen.
var holderLoc = ck3LocDB.GetOrCreateLocBlock($"bm_converted_{holder.Id}");
if (holder.GetName(config.CK3BookmarkDate) is {} holderName) {
if (ck3LocDB.TryGetValue(holderName, out var holderNameLoc)) {
string? holderNameKey = holder.GetName(config.CK3BookmarkDate);
if (holderNameKey is not null) {
if (ck3LocDB.TryGetValue(holderNameKey, out var holderNameLoc)) {
holderLoc.CopyFrom(holderNameLoc);
} else {
// Use the raw name.
// Use the raw name key.
foreach (var language in ConverterGlobals.SupportedLanguages) {
holderLoc[language] = holderName;
holderLoc[language] = holderNameKey;
}
}
}
Expand Down

0 comments on commit 6412969

Please sign in to comment.