public static Dictionary <char, char> GetDecodeCharMap(IGameInstance instance, Language language) { string filename = null; string packfile = null; if (instance.Game == GameSteamID.SaintsRow2) { filename = String.Format("charlist_{0}.txt", GetLanguageCode(language).ToLowerInvariant()); packfile = "patch.vpp_pc"; } else { filename = String.Format("charlist_{0}.dat", GetLanguageCode(language).ToLowerInvariant()); packfile = "misc.vpp_pc"; } using (Stream stream = instance.OpenLooseFile(filename)) { if (stream != null) { return(GetDecodeCharMapFromStream(stream)); } } using (Stream stream = instance.OpenPackfileFile(filename, packfile)) { if (stream != null) { return(GetDecodeCharMapFromStream(stream)); } } return(new Dictionary <char, char>()); }
public Stream GetStream() { if (Packfile == null) { return(GameInstance.OpenLooseFile(Filename)); } else { return(GameInstance.OpenPackfileFile(Filename, Packfile)); } }