示例#1
0
        /// <summary>
        /// Loads all labels from a language file and hashes them.
        /// </summary>
        /// <param name="file">Language label file path.</param>
        /// <param name="game"><see cref="GameINT"/> of the file.</param>
        public static void LoadLangLabels(string file, GameINT game)
        {
            var      options = new Options(file);
            FileBase db      = game switch
            {
                GameINT.Carbon => new Support.Carbon.Datamap(),
                GameINT.MostWanted => new Support.MostWanted.Datamap(),
                GameINT.Underground2 => new Support.Underground2.Datamap(),
                GameINT.Prostreet => new Support.Prostreet.Datamap(),
                _ => null
            };

            if (db == null)
            {
                return;
            }
            db.Load(options);

            foreach (STRBlock str in db.GetManager("STRBlocks"))
            {
                foreach (var record in str.GetRecords())
                {
                    record.Text.BinHash();
                }
            }
        }
    }