// Fixes the language display of the game internal static void FixLangDisplay(MessageDirector dir) { string[] bundles = { "achieve", "exchange" }; foreach (string bundle in bundles) { MessageBundle actor = dir.GetBundle(bundle); ResourceBundle rActor = actor.GetPrivateField <ResourceBundle>("bundle"); FileInfo fActor = new FileInfo(Application.dataPath + $"/{bundle}.yaml"); using (StreamWriter writer = fActor.CreateText()) { writer.WriteLine("#====================================="); writer.WriteLine("# AUTO GENERATED FROM THE GAME"); writer.WriteLine("#====================================="); writer.WriteLine(""); foreach (string key in rActor.GetKeys()) { writer.WriteLine($"{bundle}:" + key + ": \"" + actor.Get(key).Replace("\"", "\\\"").Replace("\n", "\\n") + "\""); } } } }
// Populates a game version private static void PopulateGameVersion(out string version, out string build, out string revision, out string store) { MessageDirector dir = GameContext.Instance?.MessageDirector; if (dir == null) { dir = Object.FindObjectOfType <MessageDirector>(); dir.Awake(); } MessageBundle bundle = dir.GetBundle(Bundles.BUILD_BUNDLE); DateTime buildRev = DateTime.ParseExact(bundle.Get("m.timestamp"), "yyyyMMddHHmmss", CultureInfo.InvariantCulture); version = bundle.Get("m.version"); build = $"{buildRev:ddMMyy}"; revision = $"{buildRev:HHmmss}"; store = TypeUtils.GetTypeBySearch("EpicDLCProvider") != null ? "Epic" : "DRM-Free"; if (TypeUtils.GetTypeBySearch("SteamDLCProvider") != null) { store = "Steam"; } }