Guest User

LoadFromArchive

a guest
Sep 2nd, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. // Read key
  2. FString Key;
  3. Archive << Key;
  4.  
  5. FEntryArray& EntryArray = KeyTable.FindOrAdd(*Key);
  6.  
  7. FEntry NewEntry;
  8. NewEntry.LocResID = LocalizationResourceIdentifier;
  9.  
  10. // Read string entry.
  11. Archive << NewEntry.SourceStringHash;
  12.  
  13. if (VersionNumber >= FTextLocalizationResourceVersion::ELocResVersion::Compact)
  14. {
  15.     int32 LocalizedStringIndex = INDEX_NONE;
  16.     Archive << LocalizedStringIndex;
  17.  
  18.     if (LocalizedStringArray.IsValidIndex(LocalizedStringIndex))
  19.     {
  20.         NewEntry.LocalizedString = LocalizedStringArray[LocalizedStringIndex];
  21.     }
  22.     else
  23.     {
  24.         UE_LOG(LogTextLocalizationResource, Warning, TEXT("LocRes '%s' has an invalid localized string index for namespace '%s' and key '%s'. This entry will have no translation."), *LocalizationResourceIdentifier, *Namespace, *Key);
  25.     }
  26. }
  27. else
  28. {
  29.     Archive << NewEntry.LocalizedString;
  30. }
  31.  
  32. EntryArray.Add(NewEntry);
Advertisement
Add Comment
Please, Sign In to add comment