Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="selectedLanguage"></param>
        /// <returns></returns>
        private static void getMyLocRes(string selectedLanguage)
        {
            if (ThePak.AllpaksDictionary != null)
            {
                if (ThePak.AllpaksDictionary.ContainsKey("Game_BR.locres"))
                {
                    string locResPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["Game_BR.locres"], "Game_BR.locres");

                    LocResSerializer.setLocRes(locResPath.Replace("zh-Hant", selectedLanguage));
                }
                else
                {
                    new UpdateMyConsole("Game_BR.locres ", Color.Crimson).AppendToConsole();
                    new UpdateMyConsole("not found", Color.Black, true).AppendToConsole();
                    new UpdateMyConsole("Icon language set to ", Color.Black).AppendToConsole();
                    new UpdateMyConsole("English", Color.CornflowerBlue, true).AppendToConsole();

                    Properties.Settings.Default.IconLanguage = "English";
                    Properties.Settings.Default.Save();
                }

                if (ThePak.AllpaksDictionary.ContainsKey("Game_StW.locres"))
                {
                    string locResPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["Game_StW.locres"], "Game_StW.locres");

                    LocResSerializer.setLocRes(locResPath.Replace("zh-Hant", selectedLanguage), true);
                }
                else
                {
                    new UpdateMyConsole("Game_StW.locres ", Color.Crimson).AppendToConsole();
                    new UpdateMyConsole("not found", Color.Black, true).AppendToConsole();
                }
            }
        }
Example #2
0
        /// <summary>
        /// 1. if loading a dynamic pak we have to switch between keys because the translation file is the main paks hence string oldKey is there
        /// 2. smh if loading a dynamic pak, the guid isn't reset when registering, the temp solution is to fake the guid
        /// </summary>
        /// <param name="selectedLanguage"></param>
        /// <returns></returns>
        private static string getMyLocRes(string selectedLanguage)
        {
            if (ThePak.AllpaksDictionary != null && ThePak.AllpaksDictionary["Game_BR.locres"] != null)
            {
                string oldKey  = JohnWick.MyKey;                                //get the old key
                string oldGuid = ThePak.CurrentUsedPakGuid;                     //get the old guid

                JohnWick.MyKey            = Properties.Settings.Default.AESKey; //set the main key to extract
                ThePak.CurrentUsedPakGuid = "0-0-0-0";                          //fake the guid -> writeFile need this guid to get the mountPoint, otherwise it crashes

                string locResPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["Game_BR.locres"], "Game_BR.locres");

                JohnWick.MyKey            = oldKey;  //set the old key
                ThePak.CurrentUsedPakGuid = oldGuid; //set the old guid

                return(LocResSerializer.StringFinder(locResPath.Replace("zh-Hant", selectedLanguage)));
            }
            else
            {
                return("");
            }
        }